水晶报表直接保存为PDF格式,而不是观看 [英] Crystal Report direct saving as PDF, instead of viewing
问题描述
我想打从ASP.Net的报告显示,水晶报表。我想,当打印用户点击,它应该简单地显示保存,打开的浏览器对话框,另存为,和PDF应保存,或水晶报表打印preVIEW应该出现,我不想首先显示报告在浏览器然后点击按钮获取打印或PDF,我想简单地从点击asp的按钮,我有所有的参数的想法,并知道如何做报告,我的问题是只是不显示浏览器,并采取从ASP按钮报告在PDF或打印preVIEW对话的形式进行打印。我已经使用的.Net水晶报表的导出方法,但它不能正常工作。
I want to make a report from ASP.Net, in Crystal Report. I want, when user click on print, it should simply show a browser dialog of Save,Open,Save as, and PDF should be saved, or Crystal Report print preview should appear, I don't want to display report first in Viewer then click on button to get print or PDF, I want simply from clicking on asp button, I have all the idea of parameters and know how to make report, my question is just to not to show viewer and take report from asp button in a form of PDF or print preview dialog to print. I have used the Export method of .Net for Crystal Report, but it does not work.
推荐答案
下面是您正在寻找解决方案:
Here is the solution you are looking for:
<一个href=\"http://www.c-sharpcorner.com/UploadFile/mahesh/ExportCRtoPDF10062006161918PM/ExportCRtoPDF.aspx\" rel=\"nofollow\">http://www.c-sharpcorner.com/UploadFile/mahesh/ExportCRtoPDF10062006161918PM/ExportCRtoPDF.aspx
下面是从网站报价:
以下步骤将引导你达到相同的:
The following steps will guide you to achieve the same:
添加水晶报表(.CR)文件到你的ASP.NET应用程序。
在页面级别添加报表实例。
Add crystal report (.cr) file to your ASP.NET application. Add a report instance on the page level.
昏暗的报告作为MyReport =新MyReport
填充报告上Page_Init数据
Populate reports data on Page_Init
昏暗DS作为数据集=的GetData()
report.SetDataSource(DS)
导出报告
report.ExportToHtt presponse(ExportFormatType.PortableDocFormat,响应,假,ExportedReport)
如果你想为其他格式格式的报表,只是ExportFormatType枚举值更改为>你想要的格式。
If you wish to format report to other formats, just change the ExportFormatType enumeration value to > your desired format.
如果您想下载该报告,那么你只需更改> ExportToHtt presponse方法的第三个参数在第4步为True。
If you wish to download the report, then you simply change the third parameter of >ExportToHttpResponse method in Step 4 to True.
这篇关于水晶报表直接保存为PDF格式,而不是观看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!