dears
I have 2 forms : form1 and form2
in form1 I have 3 comboboxes : combobox1, combobox2, combobox3 and button1
in form2 I have only reportviewer1 and a report was created it's name is report11
what I need is when I click button1 in form1 it puts the values in the comboboxes in the report in form2
how to do that ?
thanks in advance
Loading
Manoj BhoirPosted Apr 14, 2015, 11:17 AM
See this example code :
ReportParameterCollection mreportParameterCollection = new ReportParameterCollection();
mreportParameterCollection.Add(new ReportParameter("param1", this.textbox1.text));
mreportParameterCollection.Add(new ReportParameter("param2", this.textbox2.text));
this.ReportViewer1.LocalReport.SetParameters(mreportParameterCollection );
this.ReportViewer1.RefreshReport();
ReportParameter Class : https://msdn.microsoft.com/en-us/library/microsoft.reporting.webforms.reportparameter%28v=vs.90%29.aspx
ReportParameterCollection Class : https://msdn.microsoft.com/en-us/library/microsoft.reportingservices.reportrendering.reportparametercollection.aspx
For more information : http://www.c-sharpcorner.com/Forums/Thread/213920/how-to-pass-two-textboxs-value-to-reportviewer-in-C-Sharp-using.aspx
mind controllPosted Apr 14, 2015, 9:36 AM
Manoj BhoirPosted Apr 14, 2015, 9:33 AM
Passing Data between Windows Forms
http://www.codeproject.com/Articles/17371/Passing-Data-between-Windows-Forms
Using a delegate to pass data between two forms
http://www.codeproject.com/Articles/6456/Using-a-delegate-to-pass-data-between-two-forms