PDA

View Full Version : How to print Chinese Text



Anonymous
09-19-2002, 11:08 PM
Hi all,

I just downloaded jfreereport and experiemented a while. Full of fun to play with it, but I met problems in print Chinese Text out.

I want to use jfreereport to print Chinese report, but i aways failed.
I can print Chinese text out if the Chinese text in tablemode, but if I add Chinese in XML template as a header, footer or others, it can not idsplay properly except give me squares.

Can anyone tell me how to print Chinese text report?



Regards
Spica

Anonymous
09-20-2002, 09:59 AM
Hi,

have you made sure, that the text-encoding of your xml file is set correctly? If you want to write chinese reports make sure that your xml file is encoded in chinese encoding or unicode. Your editor has to support unicode when editing the file (most editors do only support WInAnsi or the native encoding of the used locale/and or OS).

see this thread for more details on the encoding problem:
http://www.object-refinery.com/phorum-3.3.2a/read.php?f=7&i=577&t=577#REPLY

Another thing that is important is that you have to use a font that is able to display the chinese characters. If in doubt, try "Arial Unicode MS", this font does support all Unicode characters currently defined (afaik). An example for Unicode encoded chinese text in reports can be found in Report3.xml, the header and footer have short test-sequences appended.

Try to modify the element definition of this report to use the font you want to use in your report. If the characters are still printed ok, then your font should be suitable for your report and the chinese text inside.

Have more fun,
said Thomas