我的网络应用程序中“没有安装打印机”错误 [英] 'no printers installed ' error in my web application

查看:132
本文介绍了我的网络应用程序中“没有安装打印机”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

c#asp.net ---'没有打印机安装'错误在我的网页应用程序中单击水晶报表中的打印选项..当我在我的服务器上运行正常但发布到网站无法在客户端机器上运行...并且没有打印机安装在客户端机器上如何编码在客户端机器中设置默认打印机..





以下是我的c#代码:< br $> b $ b

c# asp.net ---'no printers installed ' error in my web application on clicking print option in crystal report..when running on my server working fine but after publishing to website not functioning in client machine..and no printers are installed in client machine how to code to set a default printer in client machine..


following is my c# code:

protected void print_Click1(object sender, EventArgs e)
        {
            oReport1.Load(Server.MapPath("~/Report/PaySalaryMonthWise.rpt"));


            connection.DoCRLogin(oReport1);

            CrystalReportViewer1.ReportSource = oReport1;
            CrystalReportViewer1.DataBind();
            oReport1.PrintToPrinter(1, false, 0, 0);
        }

推荐答案

您必须了解您的ASP.NET / C#代码正在服务器计算机上运行 在客户端!因此,当您将网站发布到实时服务器时,它可能没有任何打印机安装程序,这就是您收到此类错误的原因。同样,您的代码正在尝试打印到安装在服务器而不是客户端的打印机。

如果要将报告打印到客户端打印机,请尝试这些链接提供的解决方案



http://scn.sap.com/thread/2066966 [ ^ ]



在ASP.NET中显示,导出和打印Crystal Reports [ ^ ]



http://goo.gl/eFSPw [ ^ ]



http://scn.sap.com/thread/1227795 [ ^ ]
You must understand that your ASP.NET/C# code is running on the server machine not on the client! So, when you publish your website to a live server, it's likely that it does not have any printer installer and that's why you get such error. Again, your code is trying to print to a printer installed at the server not at the client.
If you want to print the report to client printers, then try the solutions provided by these links

http://scn.sap.com/thread/2066966[^]

Displaying , Exporting and Printing Crystal Reports in ASP.NET[^]

http://goo.gl/eFSPw[^]

http://scn.sap.com/thread/1227795[^]


http://aspalliance.com/articleViewer.aspx?aId=509&pId=-1 [ ^ ]



http://forums.codeguru.com/showthread.php?537279-How-to-Directly-Print-a-Crystal-Reports-to-Default-Client-Printer-from-ASP-NET-withou [ ^ ]





此链接可能帮助你....
http://aspalliance.com/articleViewer.aspx?aId=509&pId=-1[^]

http://forums.codeguru.com/showthread.php?537279-How-to-Directly-Print-a-Crystal-Reports-to-Default-Client-Printer-from-ASP-NET-withou[^]


This links might help you....


这篇关于我的网络应用程序中“没有安装打印机”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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