开发者

Crystal Report viewer built in Export button problem

开发者 https://www.devze.com 2023-02-03 08:25 出处:网络
I am using VS 2010, Web application with .net 4, I downloaded Crystal report from the website that Microsoft suggests.

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 开发者_如何学CReportDocument();
 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


Modify the ReportSourceID in the Crystal Reports Viewer

0

精彩评论

暂无评论...
验证码 换一张
取 消