• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Crystal Reports XI R2 Chinese Display on PDF export

 
Eugene Wong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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);
reportClientDoc.close();
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);
byteArrayOutputStream.writeTo(fileOutputStream);
byteArrayInputStream.close();
byteArrayOutputStream.close();
fileOutputStream.close();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic