| Output encoding [message #797422] |
Mon, 13 February 2012 08:19  |
sam va Messages: 120 Registered: July 2011 |
Senior Member |
|
|
Hi
How do I set the output encoding for PDF/Excel?
The options class takes outputStream as one of the parameters but not writer. Hence we cannot set the encoding. Is there anyway?
My problem is, SOME of the french characters like euro are not coming properly in the output pdf/excel. my database is windows-1252 charset.
Thanks
|
|
|
|
|
|
| Re: Output encoding [message #799080 is a reply to message #798459] |
Wed, 15 February 2012 07:23   |
sam va Messages: 120 Registered: July 2011 |
Senior Member |
|
|
Our database charset is set to WE8MSWIN1252
Here are the outputs I have from my report
HTML, PDF, EXCEL, CSV
For generation of the report (Run Task), I did set the locale to CANADA_FRENCH
For HTML I use report tag. In that report tag I have set the locale to fr_CA. This works as expected.
For PDF, in the render task, I did set the locale to CANADA_FRENCH. It works as expected.
For Excel, in the render task, I did set the locale to CANADA_FRENCH. But IT DID NOT WORK AS EXPECTED.
For CSV, I didnt use emitter, but from the dataset fetch method, I write into a file directly by getting the data from he resultset. This also DOESNT WORK AS EXPECTED.
Here is the code while I create a file
var w = new OutputStreamWriter(new FileOutputStream(str), "CP1252");
Is there anything I need to specifically for Excel and CSV?
Meanwhile I also found out that the formatting of dates and amounts has changed
For eg a value of 1,00,000.00 is shown as 1.00.000,00.
Basically the actual locale should be US, but should also show french charcters.
Thanks
[Updated on: Wed, 15 February 2012 09:09] Report message to a moderator
|
|
|
|
|
|
|
|
| Re: Output encoding [message #802797 is a reply to message #800217] |
Mon, 20 February 2012 08:07   |
sam va Messages: 120 Registered: July 2011 |
Senior Member |
|
|
When I write with CP1252, the output contains ? in place of the following 4 characters
Œ Ÿ œ €
we are targeting to get the following characters along with normal ascii characters (all in windows code page 1252)
ÀÂÄÈÉÊËÎÏÔŒÙÛÜŸàâäèéêëîïôœùûüÿÇç«»€
When I write using UTF8, I get the characters to view correctly. But they are not the actual characters in Cp1252. They are equivalent characters in unicode.
For example
The Euro character (€) will encode as the bytes 80 under windows-1252(Cp1252), A4 under ISO-8859-15 and E2 82 AC under UTF-8. Right now in the file from UTF8, I get as "E2 82 AC". But when I write with Cp1252, I get "3F" instead of 80.
My databse character set is correct (Cp1252). But when I try to view the value in onFetch, it is coming as "?".
I have tried various options as listed below, but nothing worked for me.
1) Set the locale to en_CA/fr_CA in run/render tasks. This changed the formatting of dates and did not get the desired output
2) Set the jvm locale -Duser.country=CA -Duser.language=fr/en. Same result as above
3) Set the jvm property -Dfile.encoding=Cp1252. No change.
As of now I am getting the HTML and PDF outputs correctly. But excel and csv is an issue. For Excel, we are using native excel emitter. For CSV, we are using custom code (as I mentioned earlier, opening an file and writing in onFetch).
Jason,
Pl find the excel attached. The boxes are one of those 4 characters.
Thanks
Attachment: 8006.xlsx
(Size: 7.86KB, Downloaded 56 times)
[Updated on: Mon, 20 February 2012 08:12] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Output encoding [message #810856 is a reply to message #810485] |
Thu, 01 March 2012 11:06  |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
Thanks for the update.
Jason
On 3/1/2012 1:36 AM, sam va wrote:
> There is no issue with BIRT. The problem is with Oracle's Type-4 JDBC
> driver.
> We upgraded the driver from 10.2.0.2.0 to 10.2.0.5.0 and everything
> works like a charm
>
> Thanks
Jason Weathersby
BIRT Exchange
|
|
|
Powered by
FUDForum. Page generated in 0.02836 seconds