Retrieve Columns Automatically
Retrieve Columns Automatically
I have managed to add data source through code, is there any way i can auto populate the columns from a view or stored procedure in the designer ?
Re: Retrieve Columns Automatically
Hello,
You can use the following code.
New connection string:
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Add DataSources:
StiSqlSource DS1 = new StiSqlSource("Connection", "DS1", "DS1", "SELECT * FROM DS1", true, false);
report.Dictionary.DataSources.Add(DS1);
Add Columns:
foreach (DataColumn col in dataTableDS1.Columns)
{
DS1.Columns.Add(col.ColumnName, col.DataType);
}
Thank you.
You can use the following code.
New connection string:
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Add DataSources:
StiSqlSource DS1 = new StiSqlSource("Connection", "DS1", "DS1", "SELECT * FROM DS1", true, false);
report.Dictionary.DataSources.Add(DS1);
Add Columns:
foreach (DataColumn col in dataTableDS1.Columns)
{
DS1.Columns.Add(col.ColumnName, col.DataType);
}
Thank you.
Re: Retrieve Columns Automatically
Thanks Aleksey I've got it working now.
Re: Retrieve Columns Automatically
Hello,
Ok.
Let us know if you need any additional help.
Thank you.
Ok.
Let us know if you need any additional help.
Thank you.