Crystal Report viewer built in Export button problem

旧街凉风 提交于 2020-01-06 05:46:04

问题


I am using VS 2010, Web application with .net 4,

I downloaded Crystal report from the website that Microsoft suggests.

I added a crystal report to my web page, dragged a CrystalReportViewer, and a button.

I put in the button_click the following code:

 ReportDocument cryRpt;
 cryRpt = new ReportDocument();
 cryRpt.Load("C:\\Users\\Yazan\\Documents\\Visual Studio 2010\\WebSites\\WebSite17\\CrystalReport.rpt");
 CrystalReportViewer1.ReportSource = cryRpt;
 CrystalReportViewer1.RefreshReport();  

So it is obvious that when the button is clicked, the CrystalReportViewer appears (showing the Crystal Report I already created).

when the export button (that is already exists in the toolbar of the CrystalReportViewer) is clicked, a window is poped up letting me choose the type of format that I want to export to, and specify which pages of the report I want to export.

When I click the export button, the page is postback, and the CrystalReportViewer disappeared, and I god my old web page (without CrystalReportViewer) containing the following message:

"Failed to export using the options you specified. Please check your options and try again."

Note that this error happens for all types of file format to export to (pdf, doc...)

Please can you help me to activate the built in export button of the CrystalReportViewer?

Thanks


回答1:


Modify the ReportSourceID in the Crystal Reports Viewer



来源:https://stackoverflow.com/questions/4632386/crystal-report-viewer-built-in-export-button-problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!