PDA

View Full Version : Formatting floats and special characters



Anonymous
08-07-2002, 04:51 AM
Hello!

I'm using JFreeReport under Win98 and I have two problems.

First problem - in my TableModel I have two columns - both are float. I would like to format them in Polish style: 123 456,78
What I have to write in format string?

Second problem - I'm Polish and I want to use Polish special characters in printout. I wrote a xml file under Win98 and I have converted it from win1250 to ISO-8859-2. In xml file I have written :
<?xml version="1.0" encoding="iso-8859-2"?>
In preview I can see Polish special characters but when I see at printout I can't see them. What I'm doing wrong - am I choosing bad font, which doesn't support ISO-8859-2, or something else?

Sorry for all mistakes (I use English very rarely)

Thanks in advance

Michael

Anonymous
08-08-2002, 10:01 AM
Hi,

to problem 1: Try the formatString : "###<space>##0.78" which should do the trick. If your windows is set to polish-locale the JVM should format the numbers right, the point is replaced by the decimal sign defined by your locale.

To problem 2: Your font should be alright, as you can see the correct characters in the preview. PDF uses by default the WIN1252-encoding, you'll have to change this.

Set the System-Property "com.jrefinery.report.targets.PDFOutputTarget.ENCODING" to "Identity-H" to enable UNI-Code printing. For more information on supported encodings have a look at the iText-Documentation.
(Encoding Win1250 is supported directly using the encoding "Cp1250" for the system property).

Have more fun,
said Thomas