Symptom
How to remove Crystal Report (RPT) from export drop-down menu with SDK?
Environment
Crystal For Eclipse SP28
Resolution
- Use this method:
- 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: https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports+Java++SDK+Samples#CrystalReportsJavaSDKSamples-Exporting/Printing
- 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.ExcelRecordFormat);
//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
Keywords
CR4E, Crystal server, Hide export format, invisible, crystal export SDK. , KBA , BI-DEV-JAV , BI Software Development Kits (SDKs) - Java , Problem
Product
Attachments
sample code crystal viewer.zip |
sample code crystal viewer.zip |