Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customising Export options in Crystal Report Viewer

I am using SAP crystal reports in Visual Studio 2010.I want to customise crystal report viewer export options. That is, I want to show only export to pdf,and to excel in my crystal report viewer.
How I can do this

like image 607
Shamim Shams Avatar asked Jan 11 '12 11:01

Shamim Shams


3 Answers

Your can restrict the ReportViewer in 13.0.x using:

ReportViewer.AllowedExportFormats = (int)(ViewerExportFormats.ExcelFormat | ViewerExportFormats.PdfFormat);
like image 181
Nick Gotch Avatar answered Nov 05 '22 01:11

Nick Gotch


First of all include below namespace on top of your code behind:

using CrystalDecisions.Shared;

then,write below code in your page load event as:

protected void Page_Load(object sender, EventArgs e) {

       CrystalReportViewer2.AllowedExportFormats = (int) (ViewerExportFormats.ExcelRecordFormat | ViewerExportFormats.PdfFormat);

    }
like image 40
Hardik Jain Avatar answered Nov 05 '22 03:11

Hardik Jain


this.crystalReportViewer1.AllowedExportFormats = (int)CrystalDecisions.Shared.ViewerExportFormats.PdfFormat;

like image 1
Pranav S. Chodankar Avatar answered Nov 05 '22 02:11

Pranav S. Chodankar