Click here to Skip to main content
15,888,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an app that will print every data that is inside of the textboxes. So it means that I don't have database

I use a RDLC to fulfill the printing process. I set up parameters per textbox to my report and add this code so that the textboxes' text will be transferred to the report. (I have 10 textboxes in my form)

C#
ReportParameter textbox1param = new ReportParameter("textbox1", textbox1.Text);
printform.reportViewer1.LocalReport.SetParameters(textbox1param);


My problem though is when I do this way, it makes my system crash while printing because I repeat this code many times just to transfer every textboxes' text in my form. (I repeat the code 10 times only changing the textbox's name and the parameter name.)

I see that there is another method which is using dataset. My problem is I don't use a database because I just print what it is in the screen that the user inputted. So I can't create a query for it. Is there any other way for me to solve this dilemma? Thank you guys!
Posted
Updated 5-Feb-14 19:04pm
v2

1 solution

Lucas Juan wrote:
I see that there is another method which is using dataset. My problem is I don't use a database because I just print what it is in the screen that the user inputted. So I can't create a query for it. Is there any other way for me to solve this dilemma?
You could use Dataset. To filter the values use parameter fields. Check these
Binding DataSet and Generic *.rdlc Reports to a ReportViewer at Runtime[^]
Exporting to Word/PDF using Microsoft Report (RDLC) without using Report Viewer[^]
http://gotreportviewer.com/[^]
 
Share this answer
 

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