Jump to content
JasperReports Library 7.0 is now available ×

Encoding and database data


ktrinad

Recommended Posts

By: RR - raffarost

Encoding and database data

2003-01-07 08:37

Hi,

 

I'm using UTF-8 as character encoding set. Static fields are ok with this configuration. However, my database data has another encoding, so they aren't recognized by Acrobat Reader (they are maked with "?").

 

If I change the encoding set, iReport doesn't recognize the new characters, because it just supports UTF-8.

 

The database data encoding cannot be changed, because of compatibility.

 

Any thoughts?

 

Thank you,

 

Raffael R.

 

 

 

 

By: Michal Kalanski - mikala

RE: Encoding and database data

2003-01-08 05:53

I have database in iso8859-2 charset

I do it in this way:

--------------------------------------

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" >

<reportElement

mode="Transparent"

x="29"

y="3"

width="133"

height="23"

forecolor="#000000"

backcolor="#FFFFFF"

positionType="FixRelativeToTop"

isPrintRepeatedValues="true"

isRemoveLineWhenBlank="false"

isPrintInFirstWholeBand="false"

isPrintWhenDetailOverflows="false"/>

<textElement textAlignment="Left" lineSpacing="Single">

<font fontName="Arial.ttf" pdfFontName="Arial.ttf" size="12" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Identity-H" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{f_name}</textFieldExpression>

</textField>

-----------------------------------------------

Arial.ttf suports my codepage.

All my data from database displays OK.

 

 

 

 

By: RR - raffarost

RE: Encoding and database data

2003-01-08 07:55

Michal,

 

unfortunately, it didn't work for me.

 

I've tried to change the pdfEncoding property to "Identity-H", but it is still putting the "?" characters.

 

The font I'm using (Helvetica) supports these characters.

 

Did I forget something?

 

Thanks,

 

Raffael R.

 

 

 

 

 

By: Michal Kalanski - mikala

RE: Encoding and database data

2003-01-09 00:11

When Font file (Arial.ttf) is in directory where pdf file is generated - all chars displayed correctly.

WHen I use font from windows I don't have iso8859-2 chars.

If it dont work in yours chars I haven't any idea.

 

 

 

 

By: Giulio Toffoli - gt78

RE: Encoding and database data

2003-01-09 00:44

Hi guys.

 

Note that the database encoding (alias encoding for textfields) and XML encoding (alias encoding for static texts) are not correlated.

 

Giulio

 

 

 

 

By: RR - raffarost

RE: Encoding and database data

2003-01-09 02:42

Giulio,

 

for the XML, I'm using UTF-8 encoding. Static texts are fine (Cp1252). However, database fields are not displayed correctly, even using Cp1252.

 

With iReport 0.0.6 both static and database fields worked fine with the same configuration.

 

Would you like to see the XML?

 

Thank you,

 

Raffael

 

 

 

 

By: Giulio Toffoli - gt78

RE: Encoding and database data

2003-01-09 05:26

Ok, send me XML.

I'll make some tests.

 

Giulio

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...