首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >从网页(用ASP.NET/VB开发)打印报表(水晶报表),而不将其指向PDF

从网页(用ASP.NET/VB开发)打印报表(水晶报表),而不将其指向PDF
EN

Stack Overflow用户
提问于 2012-01-09 22:46:32
回答 3查看 7.3K关注 0票数 3

我使用Visual 2008 Server 2000作为后端,我们为公司的报表使用的报告软件要么是水晶报表9,要么是水晶报表7。

(ReportViewer.aspx)页面,我已经将水晶报表查看器控件的打印模式属性设置为PDF,因为只有两种属性PDF和ActixeX

因此出现了一个问题,如果用户单击ReportViewer.aspx页面的“打印”按钮,它将指向一个打印报表页,该页面要求用户打印他/她要打印的页面范围;然后它将自动下载用户想要打印的报告的pdf副本,然后用户应该打开下载的pdf文件并从那里打印出来。

这绝对是一个很长的过程,用户(公司员工)和经理,甚至我都不喜欢它,我试着用谷歌搜索它,这可能是我对这个领域的一点了解,所以我发现这个东西是指Visual 2005而不是2008

  • ‘-’使用ActiveX控制进行打印‘’-

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

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
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,这是一条很长的路。

EN

回答 3

Stack Overflow用户

发布于 2012-04-02 00:44:42

如果您使用ActiveX,当您按下“打印”按钮时,它将自动打印,但您需要在用户PC中安装水晶控件。

票数 1
EN

Stack Overflow用户

发布于 2012-02-29 08:59:13

查看报表运行程序批处理和报表运行程序事件服务器。它们是为轻松处理这一任务而创建的商业产品。你也可以做更多的印刷工作。

http://www.reportrunner.com

票数 0
EN

Stack Overflow用户

发布于 2013-07-26 12:22:32

将打印按钮隐藏在“水晶”工具栏中,然后,

放置一个自己的按钮,然后编写以下代码:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
CrystalReportViewer1.ReportSource = CrystalReportSource1

CrystalReportSource1.ReportDocument.PrintToPrinter(1, 1, 1, 1)

PrintToPrinter:

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8799579

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文