问题描述
大家好,我想知道为什么在调用 rdlc reportviewer.PrintDialog() 时出现故障
这是我的代码: 来自另一种形式。
我们称之为form1; 那么reportviewer所在的表单就是PrintForm;
form1 代码:
//Populating Dataset to Reports
var customer = new ReportDataSource("reportSingleCustomer",singleDS.Tables["singleCustomerDT"]);
var order = new ReportDataSource("reportSingleOrder",singleDS.Tables["singleOrderDT"]);
var payment = new ReportDataSource("reportSinglePayment",singleDS.Tables["singlePaymentDT"]);
//Clearing ReportViewer From Sources
pf.ReportViewer.Reset();
pf.ReportViewer.Clear();
//Populating ReportViewer
pf.ReportViewer.LocalReport.ReportPath = "../../PrintFolder/SingleCustomer/singleReceipt.rdlc"; //Path in Solution Explorer through the Folder
pf.ReportViewer.LocalReport.DataSources.Clear(); //Clearing Report Data;
//Adding Report Sources to Report Viewer
pf.ReportViewer.LocalReport.DataSources.Add(customer);
pf.ReportViewer.LocalReport.DataSources.Add(order);
pf.ReportViewer.LocalReport.DataSources.Add(payment);
pf.ReportViewer.RefreshReport();
//Setting Max display of ReportViewer
pf.ReportViewer.SetdisplayMode(displayMode.PrintLayout); //Fullscreen
pf.ReportViewer.ZoomMode = ZoomMode.PageWidth; //Fullscreen width;
pf.ReportViewer.ZoomMode = ZoomMode.FullPage; //FullPage in Fullscreen;
pf.ReportViewer.ZoomMode = ZoomMode.Percent; //in 100% Zoom Print Area.
PrintLoadingMainPanel.Visible = false;
pf.ShowDialog(this);
现在在 PrintForm
ReportViewer.PrintDialog();
但是每当我在 printdialog 中单击打印或取消它时,都会发生一个奇怪的关闭故障,就像您调用 .dispose() 时发生的故障一样。 rldc 中是否有这样的错误? 我正在使用 RLDC 版本 Microsoft.ReportingServices.ReportViewerControl.Winforms.150.1449.0 我没有尝试过低版本,因为我几个小时前才安装了这个。 希望你们能帮助我。 谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)