开发者

DataTable issue with SSRS in C#

开发者 https://www.devze.com 2023-02-15 00:46 出处:网络
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

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:

  1. Why there is no Channel ID?
  2. 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


  1. Look at your rdl xml. The column will show only if you have the column in there...
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消