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?
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
Try this:
Dim formats As Integer
formats = (CrystalDecisions.Shared.ViewerExportFormats.PdfFormat Or CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat)
CrystalReportViewer1.AllowedExportFormats = formats
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With