“打印到打印机"方法不适用于网络打印机 [英] "Print to Printer" method not working for Network Printers

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

问题描述



在我的Asp.Net应用程序中.我需要打印水晶报表.因此,在保存记录的同时,我为打印我的账单显示了一个弹出窗口".因此,用户可以选择已安装的打印机并自己打印.


现在,我的要求已更改,需要在保存时打印两个不同的报告.(例如,账单报告,额外费用报告)

因此,我将PRINTTOPRINTER()方法用于附加费报告.但是它会引发类似未安装打印机"的错误.但是它在我的开发PC上可以正常工作(分别打印两个报告).即使我将打印机设置为默认,它也会在服务器上造成麻烦:(

如何为这些PRINTTOPRINTER()方法设置精确打印机?



如何显示两个POPUP(用于打印两个报告)?

甚至我尝试运行脚本来显示两个弹出窗口,但都显示了一个... :(

我使用以下脚本显示POPUP



In my Asp.Net application. I need to print the Crystal Report. Hence while save the records, i have shown one ''POP UP'' for Printing my Bill. Hence user can choose their installed printer and give print of their own.


Now my requirement changed and need to Print two different reports while save.(like Bill report, Extracharge report seperately)

So, i used PRINTTOPRINTER() method for Extracharge report. But it throws error like "Printer not Installed". But it works fine on my development PC.(Print two reports seperately). Even i set that Printer as DEFAULT, it cause trouble on Server :(

How can i set Exact Printer for these PRINTTOPRINTER() method ?

or

How can i show two POPUP''s (for Print two reports) ???

Even i tried run Script for shown two Popups but either one are shown... :(

I used below script for showing POPUP

string url = "Billview.aspx?billno=" + billno.Trim() + "&billchdno=" + billchdno.Trim() + "&billdate=" + billdate;
            string fullURL = "window.open('" + url + "', '_blank', 'height=550,width=575,toolbar=yes,menubar=no,titlebar=no');";
            ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);





请帮帮我...





Please help me out...

推荐答案

调用
ReportDocument.PrintToPrinter

方法只会尝试在以下位置打印报告服务器,我想这不是您想要做的.

如果将报告合并为一个PDF文件,则用户将可以同时打印两个文件.可以使用iTextSharp之类的库在服务器上完成此操作.

method will only try to print the report on the server, which I suppose is not what you want to do.

If you merge the reports into a single PDF file the user will be able to print both at the same time. This can be done on the server using a library like iTextSharp.


这篇关于“打印到打印机"方法不适用于网络打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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