Thursday, October 3, 2013

How to change the datasource for all the reports when shared data sources not used?

i have similar problem i using report builder 2.0 to create *.rdl report and change file extension to *.rdlc and using reportviwer 2012 redistributed with C# express edition 2012 using this code Microsoft.Reporting.WinForms.ReportDataSource ght = new Microsoft.Reporting.WinForms.ReportDataSource(); reportViewer1.RefreshReport(); ght.Value = this.tetDataSet.Individual; ght.Name = "DataSource1"; reportViewer1.Visible = true; reportViewer1.ProcessingMode = pr reportViewer1.Reset(); reportViewer1.LocalReport.DataSources.Clear(); reportViewer1.LocalReport.DataSources.Add(ght); reportViewer1.LocalReport.Refresh(); using (FileStream stream = new FileStream("C:\\Users\\H.Mustaafa\\Documents\\life.rdlc", FileMode.Open)) { reportViewer1.LocalReport.LoadReportDefinition(stream); } reportViewer1.Drillthrough += new DrillthroughEventHandler(DemoDrillthroughEventHandler); this.Controls.Add(this.reportViewer1); reportViewer1.Refresh(); where data sources in both code and report definition are identical and no data appear in the form

No comments:

Post a Comment