发布到IIS时,打印到打印机不起作用 [英] print to printer not work when Published to IIS

查看:627
本文介绍了发布到IIS时,打印到打印机不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个网络应用程序,其中使用水晶报告进行报告。



我使用以下代码行

I am developing a web application in which crystal reports is being used for reporting.

I am using the following lines of code

ReportDocument rdoc=new ReportDocument();
rdoc.Load("reportname.rpt");
rdoc.SetParameterValue(0,"Value");
rdoc.PrintOptions.PrinterName="The Printer Connected";
rdoc.PrintToPrinter(1,false,0,0);



打印功能在调试时工作正常,但是当我将网站发布到IIS时,它不起作用,并没有给出任何错误或暗示或任何东西。


The print function works fine while debugging, but when I published the site to IIS, it does not work and didn''t give any error or hint or anything.

推荐答案

你确实意识到你正在编写的代码在你的服务器上执行,而不是在客户端。如果有一台打印机连接到您的服务器,它可能会在那里打印,如果它有权限。



A 刷新后的代码 [ ^ ]可能在这里使用。
You do realize that the code you are writing executes ON YOUR SERVER, and not on the client. If there were a printer attached to your server, it may be printing there if it has permission.

A Code Behind Refresher[^] may be of use here.


这篇关于发布到IIS时,打印到打印机不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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