in microsoft report viewer i want change datasource in run time
-
i add data set & add 4 table in this data set and design 4 reports for each table i want to choose the report & set datasource to report and show in microsoft report view i try this code but failed
ReportOfEng.LocalReport.ReportEmbeddedResource = "follow\_up.Report1.rdlc"; ReportDataSource ds = new ReportDataSource(); ds.Name = dataSet11.Movements.TableName; ds.Value = dataSet11.Movements; ReportOfEng.LocalReport.DataSources.Clear(); ReportOfEng.LocalReport.DataSources.Add(ds); this.movementsTableAdapter1.Fill(dataSet11.Movements); this.ReportOfEng.RefreshReport();
then in runtime when i btnclick this message appear in report "data source instance has not been supplied for dataset" so what i can do :-D
-
i add data set & add 4 table in this data set and design 4 reports for each table i want to choose the report & set datasource to report and show in microsoft report view i try this code but failed
ReportOfEng.LocalReport.ReportEmbeddedResource = "follow\_up.Report1.rdlc"; ReportDataSource ds = new ReportDataSource(); ds.Name = dataSet11.Movements.TableName; ds.Value = dataSet11.Movements; ReportOfEng.LocalReport.DataSources.Clear(); ReportOfEng.LocalReport.DataSources.Add(ds); this.movementsTableAdapter1.Fill(dataSet11.Movements); this.ReportOfEng.RefreshReport();
then in runtime when i btnclick this message appear in report "data source instance has not been supplied for dataset" so what i can do :-D
Well,
LocalReport.DataSources
has been cleared, and yet you haven't done aLocalReport.DataSources.Add
.I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
Well,
LocalReport.DataSources
has been cleared, and yet you haven't done aLocalReport.DataSources.Add
.I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
i add data set & add 4 table in this data set and design 4 reports for each table i want to choose the report & set datasource to report and show in microsoft report view i try this code but failed
ReportOfEng.LocalReport.ReportEmbeddedResource = "follow\_up.Report1.rdlc"; ReportDataSource ds = new ReportDataSource(); ds.Name = dataSet11.Movements.TableName; ds.Value = dataSet11.Movements; ReportOfEng.LocalReport.DataSources.Clear(); ReportOfEng.LocalReport.DataSources.Add(ds); this.movementsTableAdapter1.Fill(dataSet11.Movements); this.ReportOfEng.RefreshReport();
then in runtime when i btnclick this message appear in report "data source instance has not been supplied for dataset" so what i can do :-D
depend on RadioButton Check :-D
if (rdbEng.Checked==true) { ReportsOfRun.Reset(); ReportsOfRun.LocalReport.ReportEmbeddedResource = "follow\_up.Report\_Eng.rdlc"; ds.Name = "DataSetReport\_Eng\_Table"; ds.Value = Eng\_TableBindingSource; //ReportsOfRun.LocalReport.DataSources.Clear(); ReportsOfRun.LocalReport.DataSources.Add(ds); ReportsOfRun.DocumentMapCollapsed = true; this.Eng\_TableTableAdapter.Fill(this.DataSetReport.Eng\_Table,int.Parse(txtEngCode.Text)); } else if (rdbMonth.Checked==true) { ReportsOfRun.Reset(); ReportsOfRun.LocalReport.ReportEmbeddedResource = "follow\_up.Report\_Month.rdlc"; ds.Name = "DataSetReport\_Month\_Table"; ds.Value = Month\_TableBindingSource; //ReportsOfRun.LocalReport.DataSources.Clear(); ReportsOfRun.LocalReport.DataSources.Add(ds); ReportsOfRun.DocumentMapCollapsed = true; this.Month\_TableTableAdapter.Fill(this.DataSetReport.Month\_Table, txtMonth.Text); }
thanx to how try to help me
-
depend on RadioButton Check :-D
if (rdbEng.Checked==true) { ReportsOfRun.Reset(); ReportsOfRun.LocalReport.ReportEmbeddedResource = "follow\_up.Report\_Eng.rdlc"; ds.Name = "DataSetReport\_Eng\_Table"; ds.Value = Eng\_TableBindingSource; //ReportsOfRun.LocalReport.DataSources.Clear(); ReportsOfRun.LocalReport.DataSources.Add(ds); ReportsOfRun.DocumentMapCollapsed = true; this.Eng\_TableTableAdapter.Fill(this.DataSetReport.Eng\_Table,int.Parse(txtEngCode.Text)); } else if (rdbMonth.Checked==true) { ReportsOfRun.Reset(); ReportsOfRun.LocalReport.ReportEmbeddedResource = "follow\_up.Report\_Month.rdlc"; ds.Name = "DataSetReport\_Month\_Table"; ds.Value = Month\_TableBindingSource; //ReportsOfRun.LocalReport.DataSources.Clear(); ReportsOfRun.LocalReport.DataSources.Add(ds); ReportsOfRun.DocumentMapCollapsed = true; this.Month\_TableTableAdapter.Fill(this.DataSetReport.Month\_Table, txtMonth.Text); }
thanx to how try to help me
Well done, and well done for showing your solution. That's a bit of class that is. :-D
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads