打印水晶报表时出错,并显示异常消息“未安装打印机”。 [英] Error while printing crystal report, with that exception message "No printers are installed"

查看:117
本文介绍了打印水晶报表时出错,并显示异常消息“未安装打印机”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一条消息未安装打印机的异常消息。

我使用 _rptDocument.PrintToPrinter(1,false,0,0); 打印报告

I got an exception with message "No printers are installed." while printing a report for depolyed release of our website.
I use _rptDocument.PrintToPrinter(1, false, 0, 0); to print a report.

我遇到了这个例外,即使我的机器上安装了不止一台打印机。
另外,在开发过程中我也不会遇到例外,在开发进行过程中一切都很好。

I got that exception, even I've more than one printer installed on my machine. Also, I don't get that exception while development, everything while development is going fine.

我使用了发布网站和 Web项目部署 发布/部署网站的选项,但我得到了相同的结果。

I used "Publish Web Site" and "Web Project Deployment" options to publish/deploy website, but I got the same result.

有任何建议吗?

编辑

示例代码

DataSet dsResult = null;
rptDocument = new ReportDocument();
rptDocument.Load(Server.MapPath("WINGR0040.rpt"));

// Fetch report data.
...

rptDocument.SetDataSource(dsResult);

// Print report.
rptDocument.PrintToPrinter(1, false, 0, 0);


推荐答案

我真的会将报告导出为PDF,以便用户在其台式打印机上打印。但是,也许后台打印程序服务已在iis服务器上停止,因此crytsal感到困惑。

I would really export the report to PDF so the user prints at their desktop printer. However maybe the Print Spooler Service is stopped on the iis server so crytsal is confused.

这篇关于打印水晶报表时出错,并显示异常消息“未安装打印机”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆