wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes Crystal Reports XI R2 Chinese Display on PDF export Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Crystal Reports XI R2 Chinese Display on PDF export" Watch "Crystal Reports XI R2 Chinese Display on PDF export" New topic

Crystal Reports XI R2 Chinese Display on PDF export

Eugene Wong

Joined: Mar 05, 2007
Posts: 11
Dear all,

I am running JRC as a java desktop application, instead of web. There is a problem which the Chinese cannot be displayed correctly when exporting to pdf. Here is the code, any help would be great, thanks.

String incomingRPT = "incoming.rpt";
String outgoingPDF = "outgoing.pdf";
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(incomingRPT, 0);
reportClientDoc.getDatabaseController().setDataSource(rs, func, "resultTbl");
ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
byte byteArray[] = new byte[byteArrayInputStream.available()];
File file = new File(outgoingPDF);
FileOutputStream fileOutputStream = new FileOutputStream(file);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
byteArrayOutputStream.write(byteArray, 0, x);
It is sorta covered in the JavaRanch Style Guide.
subject: Crystal Reports XI R2 Chinese Display on PDF export
Similar Threads
Trouble with ODBC CSV connection when export Crystal RPT to PDF
Serialization Problem
jpg into ByteArray
PDF in new Browser window
[Crystal Reports] JRCAgent1 received a request that cannot be handled by the JRC