0
我學習通過的DevExpress 14.1.4使一個子報告DevExpress的XtraReport主從報表異常時從主報表傳遞參數
我有XtraReport1,與Orders表 XtraReport2綁定它,與OrderDetails表 XtraReport2它綁定有參數的OID,文件管理器的詳細信息按訂單
在XtraReport1的beforePrint情況下,我不喜歡教程:
private void xrLabel1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
int n = Convert.ToInt32(GetCurrentColumnValue("MaKhoa"));
((XtraReport2)((XRSubreport)sender).ReportSource).MK.Value = n;
}
但其拋
An unhandled exception of type 'System.InvalidCastException' occurred in WindowsFormsApplication1.exe
Additional information: Unable to cast object of type 'DevExpress.XtraReports.UI.XRLabel' to type 'DevExpress.XtraReports.UI.XRSubreport'.
是的,我也跟着它,但我不仔細看beforePrint擁有者,所以我犯了錯誤:3 – Andiana 2014-10-31 06:22:48