I want to show the textbox values on Form1 that I have placed in Form 2 for Reportviewer. I get an example on the Internet or I can help you get an error as shown in the picture below in the code I wrote in my application. Thanks.
- Form1 frm = new Form1();
- private void Form2_Load(object sender, EventArgs e)
- {
- this.reportViewer1.RefreshReport();
- }
- private void PassReport()
- {
- ReportParameter[] allPar = new ReportParameter[3]; // create parameters array
- ReportParameter parSum = new ReportParameter("Sum", "195");
- ReportParameter parDiscount = new ReportParameter("discount", "19");
- ReportParameter parTotal = new ReportParameter("total", "176");
- allPar[0] = parSum; //assign parameters to parameter array
- allPar[1] = parDiscount;
- allPar[2] = parTotal;
- reportViewer1.LocalReport.SetParameters(allPar); // set parameter array
- }
- private void reportViewer1_Load(object sender, EventArgs e)
- {
- PassReport();
- }
5 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Jignesh KumarPosted Dec 5, 2018, 7:58 AM
Suraj KumarPosted Dec 5, 2018, 7:55 AM
Amit GuptaPosted Dec 5, 2018, 7:12 AM
umut çelikPosted Dec 5, 2018, 6:19 AM