【问题标题】:Printing A Report (Crystal Report) From Web Page (developed in ASP.NET/VB) Without Directing It To PDF从网页打印报告(水晶报告)(在 ASP.NET/VB 中开发)而不将其定向到 PDF
【发布时间】:2012-01-10 06:46:32
【问题描述】:

我使用 Visual Studio 2008SQL Server 2000 作为后端,我们用于公司报告的报告软件是 Crystal Report 9 或 Crystal报告 7。

(ReportViewer.aspx) 页面,我已将 Crystal Report Viewer 控件的 Print Mode 属性设置为 PDF只有两个属性 PDF 和 ActixeX

所以问题来了,如果用户单击 ReportViewer.aspx 的打印按钮![在此处输入图像描述][1]页面将定向到 PRINT THE REPORT 页面,该页面询问用户他/她的页面范围想要打印;![在此处输入图像描述][2] 然后它会自动下载用户想要打印的报告的 pdf 副本,然后用户应该打开下载的 pdf 文件并从那里打印。![在此处输入图片描述][3]

这绝对是一个非常漫长的过程,用户(公司员工)以及经理甚至我都不喜欢它,我试图谷歌它,这可能是我对该领域的了解不多,所以我发现把这些东西指的是 Visual Studio 2005 而不是 2008

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

在最新版本的 Crystal Reports 中,您可以使用新的 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,这是一个很长的路要走。

【问题讨论】:

    标签: asp.net visual-studio-2008 crystal-reports activex


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      查看 Report Runner Batch 和 Report Runner Event Server。它们是为轻松处理此任务而创建的商业产品。除了打印之外,您还可以做更多的事情。

      http://www.reportrunner.com

      【讨论】:

        【解决方案3】:

        隐藏水晶工具栏中的打印按钮,然后,
        放一个你自己的按钮,然后这个代码:

        CrystalReportViewer1.ReportSource = CrystalReportSource1
        
        CrystalReportSource1.ReportDocument.PrintToPrinter(1, 1, 1, 1)
        
        PrintToPrinter:
        

        将报告的指定页面打印到使用PrintOptions.PrinterName property 选择的打印机。如果没有选择打印机,将使用报告中指定的默认打印机。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2023-03-21
          • 2012-08-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多