Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit export formats in crystal reports

For Crystal reports for visual studio .net 2005, you can export the report to various file format such as pdf, excel, word, rpt etc. If I just want to limit the user see only excel and word format and set the default file format to excel, is there a way to do it? Sometimes too many choose is not good, is it?

like image 821
Rahul Avatar asked Mar 01 '11 08:03

Rahul


2 Answers

Using CRVS2010 , you can remove unwanted export Option.

A new feature of CRVS2010 is the ability to modify the available export formats from the viewer export button. The following C# sample code demonstrates how to set the CrystalReportViewer to export only to PDF and Excel file formats:

int exportFormatFlags = (int)(CrystalDecisions.Shared.ViewerExportFormats.PdfFormat | CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat);
CrystalReportViewer1.AllowedExportFormats = exportFormatFlags;

For More Details Please refer below link..

http://scn.sap.com/community/crystal-reports-for-visual-studio/blog/2011/01/26/export-file-formats-for-sap-crystal-reports-for-vs-2010

like image 153
Hardik Vinzava Avatar answered Oct 11 '22 18:10

Hardik Vinzava


Try this:

    Dim formats As Integer
    formats = (CrystalDecisions.Shared.ViewerExportFormats.PdfFormat Or CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat)

    CrystalReportViewer1.AllowedExportFormats = formats
like image 28
Tiago Gomes Avatar answered Oct 11 '22 17:10

Tiago Gomes