我使用Visual 2008和 Server 2000作为后端,我们为公司的报表使用的报告软件要么是水晶报表9,要么是水晶报表7。
(ReportViewer.aspx)页面,我已经将水晶报表查看器控件的打印模式属性设置为PDF,因为只有两种属性PDF和ActixeX
因此出现了一个问题,如果用户单击ReportViewer.aspx页面的“打印”按钮,它将指向一个打印报表页,该页面要求用户打印他/她要打印的页面范围;然后它将自动下载用户想要打印的报告的pdf副本,然后用户应该打开下载的pdf文件并从那里打印出来。
这绝对是一个很长的过程,用户(公司员工)和经理,甚至我都不喜欢它,我试着用谷歌搜索它,这可能是我对这个领域的一点了解,所以我发现这个东西是指Visual 2005而不是2008
‘
在最新版本的水晶报告中,可以使用新的CrystalReportViewer.PrintMode属性指定打印模式。它包含两种枚举类型: ActiveX和PDF。
When the property is set to PrintMode.PDF, the report is exported as a PDF on the Web server, and then streamed to the browser. The user is given the option to print directly to the printer. This option is cross-platform compatible.
When the property is set to PrintMode.ActiveX, an ActiveX printing control allows users to print the report directly to their local printer.
Note In Crystal Reports for Visual Studio 2005, the ActiveX print control is not installed on the local machine, in order to meet Microsoft security requirements. Instead, it must be accessed as a .cab file from an external URL. The PrintControl.cab file can be downloaded from the Business Objects tech support Web Site, at which point you can place the cab file in a web server virtual directory for URL access.
To make the cab file visible to your Crystal Reports for Visual Studio 2005 Web Site, add the following xml to your Web Site's web.config file:
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="printControl" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<printControl>
<add key="url" value="http://myserver/PrintControl.cab" />
</printControl>
</crystalReports>
</businessObjects>
Note Only Internet Explorer supports ActiveX controls. Printing from a non-Internet Explorer client (FireFox, Safari, Mozilla, and others) reverts to the PDF export dialog.
“-”
如果有人能帮我的话,我会非常感激的,在按下报表查看器的打印按钮后打印报告,而不是将它指向pdf,这是一条很长的路。
发布于 2012-04-02 00:44:42
如果您使用ActiveX,当您按下“打印”按钮时,它将自动打印,但您需要在用户PC中安装水晶控件。
发布于 2012-02-29 08:59:13
查看报表运行程序批处理和报表运行程序事件服务器。它们是为轻松处理这一任务而创建的商业产品。你也可以做更多的印刷工作。
发布于 2013-07-26 12:22:32
将打印按钮隐藏在“水晶”工具栏中,然后,
放置一个自己的按钮,然后编写以下代码:
CrystalReportViewer1.ReportSource = CrystalReportSource1
CrystalReportSource1.ReportDocument.PrintToPrinter(1, 1, 1, 1)
PrintToPrinter:
将报表的指定页打印到使用PrintOptions.PrinterName property
选择的打印机。如果没有选择打印机,则将使用报表中指定的默认打印机。
https://stackoverflow.com/questions/8799579
复制相似问题