Skip to Content
Author's profile photo Ted Ueda

SAP BusinessObjects Enterprise BI 4.0 – Modify the Crystal Reports Viewer Export Format List

In this current series of SAP BusinessObjects Enterprise BI 4.0 – What’s New with the SDKs?, I’m describing new SDK functionality that I find particularly interesting in the recently released SAP BusinessObjects Enterprise BI 4.0 product.  In this brief blog entry, I’ll describe how you can modify the export format list as presented by the Crystal Report Viewer.

Crystal Report Viewer Export List

Create a bit of code to bring up a Crystal Report in the Crystal Report Web Viewer, then click on the export button.  In the export dialog box that appears, select the export format drop-down, and what you see is the following:

image

That’s one of the features of the viewer – it supports a lot of export formats.

But there’s times where you can’t or don’t want to give your clients so many choices.  For example, security and document assurance policies at an organization may explicitly prevent people from accessing the Crystal Reports (RPT) format, to eliminate any possibility of document modification.  

Or for more casual users, you may want to restrict them to only PDF and Excel exports.  

In previous versions of the viewer, there wasn’t a fully supported way of trimming specific export formats from the drop-down.  You could eliminate the export functionality altogether – which is typically not what clients want – but within strict supported deployments, you had to accept all the export formats, or none.

Modification of the export format list, when you really needed to do it, was something that had to be done outside of supported use.  There’s been a few ways – in XI Release 2 and previous, it was quite popular to edit the export.js JavaScript file included in the viewer to achieve this end.  However, one had to migrate these changes every time you applied a patch, and there was no guarantee that the same changes would work, since the export.js may have been modified by us.  

Then with XI 3.0, it no longer was possible to modify the export format list via the export.js – changes in the internal code essentially made the list not accessible via static files.  The workaround then implemented by a few involved HTTP filters – to capture and modify the outgoing HTML stream at the web app server to eliminate the unwanted exports. This was, as you can imagine, much harder to maintain.

Removing an Export Format via the Viewer SDK

The new SAP BusinessObjects Enterprise BI 4.0 version of the Viewer SDK introduces a new method, the CrystalReportViewer.removeExportFormat(…) method.  

Given an instance of the CrystalReportViewer, invoking the following:

crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.crystalReports);
//crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.PDF);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.characterSeparatedValues);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.editableRTF);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.MSWord);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.MSExcel);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.recordToMSExcel);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.recordToMSExcel2007);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.RTF);
crystalReportViewer.removeExportFormat(com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat.XML);

results in the following drop-down:

image

And there you have it – only the PDF export format remains.  It’s that simple!

Conclusion

I’m very happy that this enhancement made it into the product – the ability to modify the export list was one of the things frequently asked for by both external and internal coders.

Sample code for the above example is downloadable: JAVA_ENTERPRISE_BE14_CR_WEB_VIEW_REMOVE_EXPORT_FORMATS

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mark Richardson
      Mark Richardson
      Thanks for the Christmas Present!

      I know I have been bugging you guys about this for a couple of releases.

      Is there going to be any way to do this with the native CR Viewers in the Launchpad (InfoView) user interface in 4.0 - or is it only for custom SDK solutions...?

      Author's profile photo Mark Richardson
      Mark Richardson
      ...and I also assume that there will be a .NET SDK equivalent in BOE 4.1, right?
      Author's profile photo Ted Ueda
      Ted Ueda
      Blog Post Author
      Hello Mark,

      You sure have!

      The standalone component viewer with Crystal Reports for Visual Studio 2010 should already have the equivalent method and functionality.

      The Enterprise .NET SDK is currently planned for "Support Package 2".  There's been a change of terminology, so if you hear that it'll be available with BI 4.0 SP2, that means it's Support Package 2 (it's kind of like the former FixPacks).  With 4.0, there's no Service Packs, but something called "Minor Release".

      The 4.0 SP2 timeline isn't firm yet (so you can't quote me) but it should be near time for 4.0 general availability.

      Sincerely,

      Ted Ueda

      Author's profile photo Mark Richardson
      Mark Richardson
      Is there going to be any way to do this with the native CR Viewers in the Launchpad (InfoView) user interface in 4.0 - or is it only for custom SDK solutions...?

      Hoping that this can be managed in CMC or Config for a "vanilla" out-of-the-box user of Launchpad (InfoView) in BOE-4.0 (and Edge and CR 2011 SERVER) that is viewing Crystal Reports content.

      Author's profile photo Former Member
      Former Member
      this is first comment
      Author's profile photo Former Member
      Former Member
      i am a new java reporter.
      I do not know how to config and view report in web application with sap business objects enterprise BI 4.0
      Author's profile photo Former Member
      Former Member
      Hi,

      I am not familiar with scripting, but what is the file i need to modify within the BO4.0 directory? I thought of a file like CRYSTALREPORTSVIEWER.jsp but such a file does not exists.

      Thanks

      Author's profile photo Sebastian Pakulat
      Sebastian Pakulat

      Hi,

      please give us an Tip or an HowToPaper that explains how to deploy these kind of ZIP.

      I dont understand the doing - when i take a look at the admin guide.

      I find nothing similar only some Texts over WAR Files and stuff like this?

      What I need to deploy this Solution?

      Eclipse to make an WAR File?

      Folder?

      There are Conf Files to customize?

      Author's profile photo Ted Ueda
      Ted Ueda
      Blog Post Author

      Hello Sebastian,

      The sample is for custom-code web application developers used to integrate Crystal Reports into their application, and not for administration or enhancment of BI launchpad.

      How one creates a war file and encorporates sample JSP pages will depend on the development environment and web application server you are using.

      It's a vast scope,  and SAP Crystal Reports developers use a vast array of tools.

      There's too much scope to cover all deployment scenarios to make it appropriate for a Tip or How To paper.   Web app development is best covered by the toolset maker for the tools you are using.

      Sincerely,

      Ted Ueda

      Author's profile photo Said Shepl
      Said Shepl

      Hi Ted,

           We are working on SAP BusinessObject 4.0 SP2 PL 12

      which file we can edit it to write the above code?

      Regards

      Said Shepl