SAP Knowledge Base Article - Public

3189234 - How to remove Crystal Report (RPT) from export drop-down menu with SDK?


How to remove Crystal Report (RPT) from export drop-down menu with SDK?


Crystal For Eclipse SP28


  • Use this method:
CrystalReportViewer cr = new CrystalReportViewer();
  • This method can be used either with JSP or when using BI4 jar files or with RAS OEM or Crystal report Server 2016 or 2020.
  • This method does not exist in Crystal for Eclipse.

Workaround in Crystal For Eclipse:

Hide the Export button from the default viewer using the method: setHasExportButton(false) and create a new an export menu with the rpt format following those samples:

  • With .Net SDK this is possible using this snippet of code:

// set up the format export types:
int myFOpts = (int)(
CrystalDecisions.Shared.ViewerExportFormats.RptFormat |
CrystalDecisions.Shared.ViewerExportFormats.PdfFormat |
CrystalDecisions.Shared.ViewerExportFormats.RptrFormat |
CrystalDecisions.Shared.ViewerExportFormats.CsvFormat |
CrystalDecisions.Shared.ViewerExportFormats.EditableRtfFormat |
CrystalDecisions.Shared.ViewerExportFormats.RtfFormat |
CrystalDecisions.Shared.ViewerExportFormats.WordFormat |
CrystalDecisions.Shared.ViewerExportFormats.XmlFormat |
CrystalDecisions.Shared.ViewerExportFormats.XLSXPagebasedFormat |
CrystalDecisions.Shared.ViewerExportFormats.XLSXRecordFormat |
CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat |
CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat |
CrystalDecisions.Shared.ViewerExportFormats.XLSXPagebasedFormat |
CrystalDecisions.Shared.ViewerExportFormats.XLSXRecordFormat |
//CrystalDecisions.Shared.ViewerExportFormats.NoFormat); // no exports allowed
//int myFOpts = (int)(CrystalDecisions.Shared.ViewerExportFormats.AllFormats);

crystalReportViewer1.AllowedExportFormats = myFOpts;

See this blog on how to use CR 2020 Export to XLXS page formats:

See Also


CR4E, Crystal server, Hide export format, invisible, crystal export SDK. , KBA , BI-DEV-JAV , BI Software Development Kits (SDKs) - Java , Problem


SAP Crystal Server 2020


sample code crystal
sample code crystal