c# - rldc 报告 Winforms 中的 PrintDialog() 错误
问题描述
嘿伙计们,我想知道为什么我在调用 rdlc reportviewer.PrintDialog() 时会出现故障
这是我的代码:来自另一种形式。
让我们称之为form1;那么reportviewer所在的form就是PrintForm;
表格1代码:
//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 VERSION Microsoft.ReportingServices.ReportViewerControl.Winforms.150.1449.0 我没有尝试过较低版本,因为我几个小时前才安装了这个。希望你们能帮助我。谢谢你。
解决方案
推荐阅读
- arrays - Laravel - Eloquent - 从返回数组中获取特定值
- java - 如何使用 @type 注释从 Hibernate 自定义用户类型类中动态返回 SQL 数据类型
- ruby - 用ruby语言在字符串中查找数组的元素
- apache-spark - Spark - 结构化流式 Kafka(动态反序列化)
- javascript - 你可以用 XMLHttpRequest 做什么而不能用 Fetch API 做什么?
- python - Django:“未找到与查询匹配的评论”404 错误
- elasticsearch - 正确转义 curl 中的三引号
- asp.net-core - Blazor 内联编辑表并获取事件的所有组件值
- php - 在 MySql 更新语句中使用函数
- java - 如何构建我的 java 类以不导致来自 JPype 的 NoClassDefFoundException?