从Web页面(在ASP.NET / VB中开发)打印报表(Crystal报表)而不用将其定向到PDF [英] Printing A Report (Crystal Report) From Web Page (developed in ASP.NET/VB) Without Directing It To PDF

查看:300
本文介绍了从Web页面(在ASP.NET / VB中开发)打印报表(Crystal报表)而不用将其定向到PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Visual Studio 2008 SQL Server 2000 作为后端,我们用于公司报告的报告软件是Crystal Report 9或Crystal报告7。 在(ReportViewer.aspx)页面中,我已设置 Crystal Report Viewer 控制为 PDF ,因为只有两个属性 PDF和ActixeX





所以这里的问题,如果用户点击ReportViewer.aspx的打印按钮[enter image description here] [1]页面,它指向一个打印报告页面,询问用户他/她想要打印的页面范围; [然后它将自动下载用户想要打印的报告的pdf副本,然后用户应该打开下载的pdf文件并打印从这里开始。[enter image description here] [3]



这是一个非常漫长的过程,用户(公司员工)不喜欢它,我试图google它,它可能是我的字段的小知识,所以我发现这是指的是Visual Studio 2005而不是2008




  • ' - ' - '使用ActiveX控件打印' - ' - ' -



在最新版本的Crystal Reports中,您可以使用新的CrystalReportViewer.PrintMode属性指定打印模式。它包含两个枚举类型:ActiveX和PDF。

 当属性设置为PrintMode.PDF时,报告导出为在Web服务器上的PDF,然后流式传输到浏览器。用户可以直接打印到打印机。此选项具有跨平台兼容性。 
当属性设置为PrintMode.ActiveX时,ActiveX打印控件允许用户将报告直接打印到本地打印机。

注意在Crystal Reports for Visual Studio 2005中,ActiveX打印控件未安装在本地计算机上,以满足Microsoft的安全要求。相反,它必须作为.cab文件从外部URL访问。 PrintControl.cab文件可以从Business Objects技术支持网站下载,此时您可以将cab文件放在Web服务器虚拟目录中以进行URL访问。

要使您的Crystal Reports for Visual Studio 2005网站可以看到cab文件,请将以下xml添加到您的网站的web.config文件:

< configSections>
< sectionGroup name =businessObjects>
< sectionGroup name =crystalReports>
< section name =printControltype =System.Configuration.NameValueSectionHandler,System,Version = 1.0.3300.0,Culture = neutral,PublicKeyToken = b77a5c561934e089,Custom = null/>
< / sectionGroup>
< / configSections>

< businessObjects>
< crystalReports>
< printControl>
< add key =urlvalue =http://myserver/PrintControl.cab/>
< / printControl>
< / crystalReports>
< / businessObjects>

注意只有Internet Explorer支持ActiveX控件。从非Internet Explorer客户端(FireFox,Safari,Mozilla和其他)进行打印将恢复为PDF导出对话框。

' - ' - ' - ' - ' -


$ b b

我真的很感激,如果有人可以帮助我,在打印报告查看器的打印按钮后打印报告,而不是指导它的pdf是一个很长的路。


<如果您使用ActiveX,当您按下打印按钮,它会自动打印,但您需要在用户PC中安装Crystal Control


I'm using Visual Studio 2008 and SQL Server 2000 as a back end and the reporting software we do use for the company's reports is either Crystal Report 9 or Crystal Report 7.

The (ReportViewer.aspx) page, I've set the Print Mode property of the Crystal Report Viewer Control to PDF as there are only two properties PDF and ActixeX

So here comes the problem, if the user clicks the print button of the ReportViewer.aspx ![enter image description here][1]Page it directs to a PRINT THE REPORT page which asks the user the page range he/she wants to prints;![enter image description here][2] Then it'll automatically download a pdf copy of the report the user wanted to print, and the user should then open the downloaded pdf file and print it from there.![enter image description here][3]

This is absolutely a very long process and the users (Company Staff) as well the managers and even me aren't fond of it, I tried to google it and its may be my little knowledge of the field, so I found out this stuff which is referring to Visual Studio 2005 and not 2008

  • ' - ' - ' Printing using the ActiveX control ' - ' - '-

In recent versions of Crystal Reports, you can specify the print mode using the new CrystalReportViewer.PrintMode property. It contains two enumerated types: ActiveX, and 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.

' - ' - ' - ' - ' -

I'd really appreciate if any one can help me, print the report after hitting the print button of the report viewer instead of directing it to pdf which is a very long way.

解决方案

If you use ActiveX when you will press the print button it will print automatically but you need to install Crystal Control in Users PC

这篇关于从Web页面(在ASP.NET / VB中开发)打印报表(Crystal报表)而不用将其定向到PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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