水晶报表在PDF文件中? [英] Crystal Reports in a PDF file?

查看:188
本文介绍了水晶报表在PDF文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码将Crystal报表输出到ASP.NET应用程序:

  Dim rptDocument As New ReportDocument 
Dim rptPath As String = Server.MapPath(Reports / Employees.rpt)

rptDocument.Load(rptPath)
Me.CrystalReportViewer1.ReportSource = rptDocument

一切正常。我的问题是,是否有一种方法来将报告呈现为PDF文件而不是呈现给crystalreportviewer?



我使用Visual Studio 2008和Crystal Reports for Visual Studio 2008。

解决方案

是的,您可以使用 ExportToHttpResponse 。将导出格式类型设置为PortableDocFormat。请查看此教程。 / p>

I am using the following code to output a Crystal Report to an ASP.NET application:

Dim rptDocument As New ReportDocument
Dim rptPath As String = Server.MapPath("Reports/Employees.rpt")

rptDocument.Load(rptPath)
Me.CrystalReportViewer1.ReportSource = rptDocument

Everything is working fine. My question is, is there a way to render the report as a PDF file instead of rendering to a crystalreportviewer?

I am using Visual Studio 2008 and Crystal Reports for Visual Studio 2008.

解决方案

Yes, you can use ExportToHttpResponse. Set the ExportFormatType to PortableDocFormat. Check out this tutorial.

这篇关于水晶报表在PDF文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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