In meinem RDLC-Bericht erstelle ich Parametertest. In Form schreibe ich Code unten auf den Parameter:Set Parameter RDLC-Bericht C#
//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();
Wenn ich das Programm laufen I Ausnahme haben
Eine nicht behandelte Ausnahme des Typs 'Microsoft.Reporting.WinForms.MissingReportSourceException' aufgetreten in Microsoft .ReportViewer.WinForms.dll
Zusätzliche Informationen: die Quelle der Berichtsdefinition wurde nicht
angegeben
Bitte helfen.
Funktioniert es, wenn Sie den parameterbezogenen Code entfernen? – InitK
Ja, es funktioniert gut –