从IIS中的应用程序打印到服务器上的网络打印机 [英] Printing from an application in IIS to a networked printer on server

查看:1683
本文介绍了从IIS中的应用程序打印到服务器上的网络打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个线code,我可以作为工作完全正常服务的一部分在本地运行。

I have a line of code that I can run locally as part of a service that works perfectly fine.

sReportPath = objCrystalUtils.ExportReportToPDF("Report Name", iReportInfoID)

这code运行作为服务的一部分,当喂养它的数据我单位测试了一下,最终生成的报告,并打印出来。

This code is run as a part of a service, and when I unit test it by feeding it data, it ultimately builds the report and prints it.

当我从一个AJAX调用运行ashx的内部完全相同的一块code。生成的报告(我可以看到在磁盘上所创建的PDF文件),但打印没有发生。

When I run the exact same piece of code inside an .ashx from an ajax call. The reports are generated (I can see the pdf files being created on disk) but the printing is not happening.

 oRpt.PrintToPrinter(objReport.DefaultAutoPrint, True, 0, 0)

在这两种情况下相同的code,以便打印报告。 (objReport.DefaultAutoPrint = 0在这两种情况下)

In both scenarios the same code is used to print the report. (objReport.DefaultAutoPrint = 0 in both cases)

我唯一的想法是,在code,它是调用此方法的位置是相对于纸币自己的位置的不同点。

My only thought is that the location of the code that is calling this method is in a different spot relative to the location of the bills themselves.

这是我想要打印到打印机龙头安装在我的机器上的网络打印机,我运行Windows 7的IIS 6.1

The printer that I'm trying to print to is a network printer intalled on my machine, and I'm running Windows 7 IIS 6.1

有什么想法?

编辑:

下面是一个想法......如果我运行一个作为一个单元测试在本地和IM运行的其他通过通过IIS中运行的Web应用程序,有用户ID和用户访问的默认打印机的区别?

Here is a thought... if I'm running one as a unit test locally and im running the other through a web app that is running via IIS, is there a difference in user id and user access to the default printer?

编辑:

所以我增加了我的本地ASP,IUSR和系统用户到打印机的安全性,并允许他们打印...没有骰子。所以,我检查了每个人的用户,它是设置了访问,并拒绝任何用户......所以我觉得还挺杀死该行的推理。

So I added my local ASP, IUSR and SYSTEM users to the printer security and allowed them to print... no dice. So I checked the EVERYONE user and it is set to access and NO users are denied... so I think that kinda kills that line of reasoning.

编辑:

我改变了这个帖子的名字,因为我不再想这个问题是AJAX相关的,因为如果我尝试做从一个Ajax调用我仍然在运行它的相同过程code bebehind从一个回而不是获得了同样的问题。

I changed the name of this post since I no longer think that the issue is ajax related since If I try to do the same process in code bebehind from a post back instead of running it from an ajax call i still get the same problem.

推荐答案

帕特里克,对我来说这是Crystal Reports的一个已知的问题,打印从通过IIS运行的应用程序一定报告。

Patrick, for me it is a known issue of crystal reports, printing a certain report from a running application via IIS.

我之前得到了同样的问题,在我们寻求这个问题,我们得到了以下的;

I got the same issue before, and upon our search for that issue, we got the following;

Report to be generated, exported, and then to be downloaded to client machine,  
so user can print it locally (say, report will be exported as PDf file, 
user can use print option of PDF reader).

这篇关于从IIS中的应用程序打印到服务器上的网络打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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