In my rdlc report I create parameter test. In form I write below code to set parameter:
//Set Parameters
ReportParameter[] p = new ReportParameter[1];
p[0] = new ReportParameter("Test", "Testing");
currentBilling_rv.LocalReport.SetParameters(p);
// Provide datasource to report Current_Total_Billing.rdlc
ReportDataSource rds = new ReportDataSource("CurrentTotalBilling", dataset.Tables[2]);
currentTotalBilling_rv.LocalReport.DataSources.Clear();
currentTotalBilling_rv.LocalReport.DisplayName = "Current Total Billing";
currentTotalBilling_rv.LocalReport.ReportPath = ".\\Current_Total_Billing.rdlc";
currentTotalBilling_rv.LocalReport.DataSources.Add(rds);
currentTotalBilling_rv.RefreshReport();
When I run the program I have exception
An unhandled exception of type 'Microsoft.Reporting.WinForms.MissingReportSourceException' occurred in Microsoft.ReportViewer.WinForms.dll
Additional information: The source of the report definition has not been specified
Please help.
In your code you are setting a parameter for a ReportViewer
named currentBilling_rv
not for currentTotalBilling_rv
which is used in the next lines of code.
If currentBilling_rv
name is correct verify that currentBilling_rv.LocalReport.ReportPath
is compiled.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.