如何打印水晶报表直接向网络打印机在Vb.net或C#.NET Windows应用程序 [英] How to printing crystal report directly to network printer in Vb.net or C#.net in Windows Applications
问题描述
我写了下面的代码,
Dim report As New ReportDocument
report.PrintOptions.PrinterName = "\\network\printer"
report.Load(CrystalReportName.rpt, OpenReportMethod.OpenReportByDefault)
report.PrintToPrinter(1, False, 0, 0)
当我试图运行此代码,它显示错误消息已指定了无效的打印机。如果我给本地打印机的名称,这是工作的罚款。但我不能能够直接打印水晶报表到网络打印机。那种需要帮助。先谢谢了。
when i am trying to run this code , it shows the error message as "Invalid Printer Specified". If i give the local printer name, it is working fine. But i can't able to print the crystal report directly to the network printer. Kind help needed. Thanks in advance.
Sivakumar.P
Sivakumar.P
推荐答案
可能是打印机名称是错误的。
May be the printer name is wrong.
请使用下面的代码调试什么名字,而选择网络打印机
Please use the following code to debug what name is coming while choosing the network printer
http://www.codeproject.com/KB/printing/printtoprinter.aspx
,然后分配合适的名字。
and then assign proper name.
不过,如果柜面它不工作了,有可能是一个然后权限问题看
Still if incase it did not work out, there might be a permission issue then look at
的http:/ /forums.asp.net/t/1383129.aspx
祝您好运。
这篇关于如何打印水晶报表直接向网络打印机在Vb.net或C#.NET Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!