Good afternoon,
In the designer, I am setting a DataSource so that I can get the list of fields that are available in the report.
At runtime however, while I use the same fields, the SQL I use to generate the query can be one of many different combinations.
My question is, how can I use a DataTable as the datasource of the report? The code below is not working (it always returns the results of the DataSource from the designer, as opposed to the DataTable (tbl).
StiReport report = new StiReport();
report.Load("REPORTNAME");
DataTable tbl = ReportDataSource();
report.RegData(tbl);
StiWebViewer1.Report = report;
StiWebViewer1.DataBind();
Thanks!
Bind report to DataTable
Bind report to DataTable
Hello,
Please try to use this code:
Please try to use this code:
Thank you.StiReport report = new StiReport();
report.Load("REPORTNAME");
report.Dictionary.Databases.Clear();
DataTable tbl = ReportDataSource();
report.RegData(tbl);
report.Render(false);
StiWebViewer1.Report = report;
Bind report to DataTable
This did not work - all pages come up blank even though the DataTable has rows. I have defined the columns and a datasource in the report designer, I don't know if that matters.
I can include the report mrt if that would help.
Thanks.
I can include the report mrt if that would help.
Thanks.
Bind report to DataTable
Hello,
Please send us your MRT file, and also data for it, that would reproduce the problem.
You can send your files to support[at]stimulsoft.com with the link to this topic.
Thank you.
Please send us your MRT file, and also data for it, that would reproduce the problem.
You can send your files to support[at]stimulsoft.com with the link to this topic.
Thank you.