DataTable issue with SSRS in C#
I have a filled DataTable and I would like to pass it to a Report in c#. before I do this I test the DataTable in a DataGridView to make sure the dat开发者_如何学JAVAa is accurate in the result I get this:(LINK TO IMAGE)
http://www.sevakabedi.com/grid.jpg
so after making sure that the data within the DataTable is correct I run this code:
this.reportViewer1.LocalReport.DataSources.Clear();
this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsReports", dt));
this.reportViewer1.RefreshReport();
The result that I get in the report is this:
http://www.sevakabedi.com/report.jpg
Here are my questions:
- Why there is no Channel ID?
- Why is the Call Date in long date format?
The full source code along with the Database script is available from the link below, you can download it:
http://www.sevakabedi.com/IVR_Reports.zip
- Look at your rdl xml. The column will show only if you have the column in there...
- The date format - you can specify in the rdl xml file...
the call date is fixed. I changed the textbox format to "d" in rdlc. And the name of the datatable field in the DATASET was wrong, I changed it too the exact name in the query and it worked.
精彩评论