I created a window form that acts as a report loader. I also created two RDLC reports from the Report Wizard, and he automatically created a dataset for these two reports. Now I have two data sets: sparcsn4DataSet.xsd and sparcsn4DataSet1.xsd, which use the stored procedure and pass two parameters (dateFrom / dateTo). I have a problem with binding to a data set depending on state:
if (idRep.Equals("extraMove"))
Simply link the dataset to the report if you have one report.
but what if you have a few? I can always create another form with another Reportviewer, but this is not an option (what if you have 10 reports / datasets), it definitely can not be considered?
There must be a way to bind the dataset to the reportviewer ... Does anyone have an idea how I can solve the status binding problem?
if (idRep.Equals("extraMove")) { this.AGCT_ServiceEventReportTableAdapter.Fill(this.sparcsn4DataSet.AGCT_ServiceEventReport, d1,d2); } else if (idRep.Equals("stripStuff")) { this.AGCT_StripStuffReportTableAdapter.Fill(this.sparcsn4DataSet1.AGCT_StripStuffReport, d1, d2); } else { MessageBox.Show("Ooops, something went wrong...!"); }
This is ReportForm.cs that has Reportviewer on it:
namespace NavisReportLoader { public partial class ReportForm : Form { public DateTime d1; public DateTime d2; public string dat1; public string dat2; public string idRep; public ReportForm() { InitializeComponent(); } public void passParam(string dateFrom, string dateTo, string date1, string date2) {
source share