Jump to content
We've recently updated our Privacy Statement, available here ×

Trouble showing Chinese data in PDF files


rkm258

Recommended Posts

Languages supported by the application - English, Spanish, French, Chinese and Arabic
The data in the database (postgres 8.4 with Encoding - UTF8) can contain these languages.

Currently I'am trying to support Chinese Language in the existing reports (generated currently as pdf files) present in the application.

Ex: Attached is a sample where Department Name, Subject Name, Course Name and others can be in any of the language types, accessed using $F{field name} syntax.
1. A text field defined by IReports as below is working fine for Spanish, French and English, and I can see the text in the generated pdf file. The data is accessed using the $F{field name} syntax.

   <textField isStretchWithOverflow="true">
    <reportElement x="0" y="0" width="105" height="34"/>
    <box leftPadding="3">
      <pen lineColor="#8ABCFF"/>
        <topPen lineWidth="0.0" lineColor="#8ABCFF"/>
        <leftPen lineWidth="0.0" lineColor="#8ABCFF"/>
        <bottomPen lineWidth="0.0" lineColor="#8ABCFF"/>
        <rightPen lineWidth="0.75" lineColor="#8ABCFF"/>
    </box>
      <textElement verticalAlignment="Top">
      <font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>
      </textElement>
  <textFieldExpression class="java.lang.String"><![CDATA[$F{course_name}]]></textFieldExpression>
 </textField>


Question:

1. I tried setting the Text Field element properties as below, but the pdf report is having blank contents
   Pdf Font Name - STSong-Light
   Pdf Embedded = TRUE
   Pdf Encoding - UniGB-UCS2-H (Chinese Simplified)
2. How can I support Chinese, what are the changes I need to make in the report Text Fields element?
3. Should there be separate Report Template jrxml files created for Chinese, OR can I support it by using the same jrxml files. Keeping in mind that there is English, Spanish and French too?
4. Please provide me with any documentation/samples that will guide me with this?

Any Suggestion as welcome,

Thanks

Ram



Post Edited by rmukkamalla at 01/29/2010 20:58
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...