on 09-24-2014 3:56 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.