java调用打印机 慢_如果打印机无效,Crystal Reports加载速度非常慢

在Crystal Reports中,如果其他开发人员设计了报表,我会看到错误“此报表使用的打印机无效 . 将使用默认打印机 . ”

我注意到,当他们收到此错误消息时,以编程方式打开报告需要花费很长时间 . 使用无效打印机加载一个报告需要1 1/2分钟,然后在我修复打印机时加载仅需5秒钟 . 问题是,我们可以在我们的网络打印机中修复报告,但我们将软件部署到没有打印机设置的客户 . 他们可能拥有所有报告的加载时间 .

How do I set the printer programatically to the default printer, to speed the report loading up?

下面的代码不起作用;至少,它仍然需要1 1/2分钟加载,无论我是否能够从该打印机名称打印 . 我正在使用ReportDocument(CrystalDecisions.CrystalReports.Engine.ReportDocument)对象进行打印 . 这是代码片段,以及我尝试设置新打印机的位置 .

// Create CrystalDecisions.CrystalReports.Engine.ReportDocument object

ReportDocument crReportDocument = new ReportDocument();

// Typically this is set to .PortableDocFormat

ExportFormatType selectedOutputType = m_ExportFormat;

System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();

crReportDocument.PrintOptions.PrinterName = printerSettings.PrinterName;

// Load() takes an EXTREMELY long time

// if the RPT file is saved with a printer not found on this computer.

crReportDocument.Load(m_FileName);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值