Click here to Skip to main content
15,894,740 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more: , +
Hello,

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 data is accurate in the result I get this:

http://sevakabedi.com/grid.jpg[^]

so after making sure that the data within the DataTable is correct I run this code:

MIDL
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[^]

Question no 1: Why there is no Channel ID?
Question no 2: Why 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[^]
Posted

1 solution

OP wrote:
Question no 1: Why there is no Channel ID?

Did you mean 'Call channel No'? BTW check whether that field has any properties/formatting(visibility, color, etc,) or small width...I'm sure it will be a minor issue.
OP wrote:
Question no 2: Why Why is the Call Date in long date format?

You should change the format, you can...look at these posts.
Report Design (rdlc) - how to format a date string[^]

FormatDateTime in rdlc report[^]

BTW I can't open your project because I have VS 2008.
 
Share this answer
 
Comments
Mastersev 3-Mar-11 11:25am    
the call date is fixed. I changed the textbox format to d.
thatraja 3-Mar-11 12:01pm    
what about the other one? fixed that too?
Mastersev 3-Mar-11 12:11pm    
just fixed it, the name of the datatable field in the DATASET was wrong, I changed it too the exact name in the query and it worked.
thatraja 4-Mar-11 11:13am    
Glad you have fixed the other one yourself.
BTW we are here in CP for you all, you can come here any time. Cheers :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900