Click here to Skip to main content
15,889,862 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table for our employees to view which we need to print and have them sign.

To do this I'm using the ReportViewer (or trying to. I'm open to other suggestions).

I've read this article but I don't think it's quite what i'm looking for - but close, and if this is the best there is i'll go this method in the end Using-the-ASP-NET-ReportViewer-in-Local-Mode[^]


Q: How to I get my table to the reportviewer? It's not just straight up from a datatable. It's more like - take 5 tables with data from multiple employees on certain jobs and calculate efficiency and report on how this employee measures up sort of table. But it's already made! Can I just pass it through?!

Thank you for your time

What I have tried:

I've read a few of the articles here and looked at many youtube videos to setup everything with the report1.rdlc and reportviewer inside the form. It runs and it's perfect but now I need to get my custom table into the table on the report, that's where I'm stuck.
Posted
Updated 9-Sep-16 11:00am
v3
Comments
RavonX 8-Sep-16 18:08pm    
comment: it seems like maybe the best solution is here in this post http://www.codeproject.com/Articles/473844/Using-Custom-Data-Source-to-create-RDLC-Reports

Where I'll need to create a couple classes and convert my custom table to a list. IDK though. why can't it just take the table?! Still searching around.

1 solution

found the answer on this page
Binding-Datatable-to-rdlc-report[^]

Basically:
1) setup a new dataset with a datatable defined EXACTLY as your table is
2) use mock dataset in the RDLC to bind to table / list / matrix / etc..
3) link the table to the report using
'ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", reportTable))'

Finished!
 
Share this answer
 
Comments
Sinisa Hajnal 12-Sep-16 2:30am    
Good work! The best problems are the ones you resolve yourself. No quitting :)
I do the same and I'm not familiar with any better method. It works with Crystal Reports too.

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