且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用C#从ASP.NET打印Zebra标签

更新时间:2023-02-08 07:57:43

如果您希望在客户端打印机上打印代码,则代码将无法运行,因为您的代码在服务器端运行并将尝试打印到该服务器上可用的打印机。

要打印到客户端打印机使用:



1. javascript代码即经典window.print( https://www.google.com/#q=asp.net+window.print [ ^ ])



2.或尝试一些报告免费的ReportViewer RDLC报告工具( http://www.gotreportviewer.com/ [ ^ ])



3.或尝试将原始Zebra命令发送到打印机:



http://start-coding.blogspot。 com / 2010/02 / print-zebra-barcode-label-thru-asp-net.html [ ^ ]

http://forums.asp.net/t/1835622.aspx [ ^ ]
Your code will not work if you expect it to be printed at the client printer because your code runs at server side and will try to print to the printer available at that server.
To print to client printer use:

1. javascript code i.e. the classic window.print (https://www.google.com/#q=asp.net+window.print[^])

2. or try some reporting tool like free ReportViewer RDLC reports (http://www.gotreportviewer.com/[^])

3. or try sending raw Zebra commands to the printer:

http://start-coding.blogspot.com/2010/02/print-zebra-barcode-label-thru-asp-net.html[^]
http://forums.asp.net/t/1835622.aspx[^]