简体   繁体   中英

How to set encoding type for birt reports

I have a database with values in Hebrew. When I generate the BIRT report, the characters are coming out in different symbols. I believe the problem is the encoding type is incorrect and I would like to set it to 'UTF-8'.

I looked in the fontsConfig.xml but I don't quite understand it. Does anyone know if we can send in a parameter to BIRT to change the encoding type if the client is using the Hebrew database?

Thanks

Have you ensured that the ViewerFilter is setup correctly in your web.xml? It ensures that all requests have their encoding set to UTF-8, eg:

....
<filter>
    <filter-name>ViewerFilter</filter-name>
    <filter-class>org.eclipse.birt.report.filter.ViewerFilter</filter-class>
</filter>
....
<filter-mapping>
    <filter-name>ViewerFilter</filter-name>
    <servlet-name>ViewerServlet</servlet-name>
</filter-mapping>
<filter-mapping>
    <filter-name>ViewerFilter</filter-name>
    <servlet-name>EngineServlet</servlet-name>
</filter-mapping>
..

I mananged to solve this by doing the following.

I was using BIRT 2.0.0 and for some reason it doesn't output the hebrew characters correctly on pdf. I upgraded to the latest version (3.7) and did a test through the WebViewerExample and I was able to generate a pdf with hebrew characters.

Long story short, I managed to upgrade the version and I was able to generate it correctly. I didn't do much with the fontsConfig.xml or setup the ViewerFilter but this help solve my issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM