using different redlc while generating a report
- Hi,
I m using 4 different reports to my query.
if the user selects choice no 1 then 1.rdlc is to be generated .
if user selects choice no 2 then 2.rdlc is to be generated and so on.
the problem is once the user selects choice no1 the particular report (1.rdlc) is generated n now when the user goes back n selects choice no2 , this time 1.rdlc only is generated n nt 2.rdlc. How to solve this. Even though i ve changed the embedded source it shows up the previous report only
code is provided below
private void ReportDesign(Microsoft.Reporting.WinForms.ReportDataSource reportDataSource1, Microsoft.Reporting.WinForms.ReportDataSource reportDataSource2, Microsoft.Reporting.WinForms.ReportDataSource reportDataSource3)
{
this.reportViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
reportDataSource1.Name =
"DailyReportDataSet_Summary";
reportDataSource1.Value =
this.summaryBindingSource;
reportDataSource2.Name =
"DailyReportDataSet_Details";
reportDataSource2.Value =
this.detailsBindingSource;
reportDataSource3.Name =
"DailyReportDataSet_RefPhysicianShare";
reportDataSource3.Value =
this.RefPhysicianShareBindingSource;
this.reportViewer1.LocalReport.DataSources.Add(reportDataSource1);
this.reportViewer1.LocalReport.DataSources.Add(reportDataSource2);
this.reportViewer1.LocalReport.DataSources.Add(reportDataSource3);
if (cbReportType.Text == "OutPatient Invoice Details Report")
{
this.reportViewer1.LocalReport.ReportEmbeddedResource = "PracticeManagement.ReportModule.Views.OutPatientInvoiceDetailsReport.rdlc";
}
else if (cbReportType.Text == "Diagnostic Lab Report"||cbReportType.Text=="OutPatient Collection Report")
{
this.reportViewer1.LocalReport.ReportEmbeddedResource = "PracticeManagement.ReportModule.Views.DiagonsticLabReferenceReport.rdlc";
}
else if (cbReportType.Text == "General Report")
{
this.reportViewer1.LocalReport.ReportEmbeddedResource = "PracticeManagement.ReportModule.Views.Report1.rdlc";
}
this.reportViewer1.Location = new System.Drawing.Point(0, 0);
this.reportViewer1.Name = "reportViewer1";
this.reportViewer1.Size = new System.Drawing.Size(609, 509);
this.reportViewer1.TabIndex = 0;
}
Meghana Lohit- Moved byLing WangMSFTSaturday, October 31, 2009 2:05 PMfor better support (From:Windows Forms General)
All Replies
- Hi Lohit,
Instead of passing the Data Set first try to map the rdlc and then add datasource, below i have given my code which is working fine
and try to refresh the reoport after assigning dataset and path of the report
ReportViewer1.LocalReport.ReportPath = Server.MapPath(
"Report2.rdlc")
ReportViewer1.LocalReport.DataSources.Add(
New ReportDataSource("SampleDataSet_StudentInfo", Ds.Tables(0)))
ReportViewer1.LocalReport.Refresh()
Hope this helps
-Raja Sekhar K - No this did not solve my problem.Could any1 tel me what is the solution for this
Meghana Lohit


