cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting Report to PDF - Report Application Server 2013

Former Member
0 Kudos

I am trying to export a report to PDF format by using the following code:

ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) clientDoc.getPrintOutputController().export(ReportExportFormat.PDF);

This code works when using the XI version of the Report Application Version. However, I am recently upgrading to 2013 and when trying to export I am getting a java.lang.ClassCastException

I tried to search for the API Reference and Developer Guide for the 2013 version, however I couldn't find it. The most recent version that I could find is the 2011 version.

Could you please guide me with a sample of how an export is done and do you have any links for the API Reference and Developer Guide for the 2013 version?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Clive,

Classcast exception is because of the below lines

ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) clientDoc.getPrintOutputController().export(ReportExportFormat.PDF);

The method clientDoc.getPrintOutputController().export(ReportExportFormat.PDF); returns an InputStream. This change has been introduced since XI 3.1 SP6 and subsequently to Crystal 2013

Use it as below

InputStream byteArrayInputStream = (InputStream) clientDoc.getPrintOutputController().export(ReportExportFormat.PDF);

Thanks,

Prithvi

Former Member
0 Kudos

Thanks for the explanation

Answers (1)

Answers (1)

former_member188030
Active Contributor
0 Kudos

RAS SDK APis are the same for CRS 2011 and CRS 2013.

See the documentation here.

http://scn.sap.com/docs/DOC-27465

Sample application are here:

http://scn.sap.com/docs/DOC-51445

Java RAS SDK Samples

http://wiki.scn.sap.com/wiki/x/HgBmBQ

Business Objects / BI Managed Java RAS SDK Sample Applications

http://scn.sap.com/docs/DOC-50606

- Bhushan

Senior Engineer

SAP Active Global Support

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place