简体   繁体   English

如何设置 birt 报告的编码类型

[英]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.当我生成 BIRT 报告时,字符以不同的符号出现。 I believe the problem is the encoding type is incorrect and I would like to set it to 'UTF-8'.我认为问题在于编码类型不正确,我想将其设置为“UTF-8”。

I looked in the fontsConfig.xml but I don't quite understand it.我查看了 fontsConfig.xml 但我不太明白。 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?有谁知道如果客户端使用的是希伯来语数据库,我们是否可以向 BIRT 发送一个参数来更改编码类型?

Thanks谢谢

Have you ensured that the ViewerFilter is setup correctly in your web.xml?您是否确保在 web.xml 中正确设置了 ViewerFilter? It ensures that all requests have their encoding set to UTF-8, eg:它确保所有请求都将其编码设置为 UTF-8,例如:

....
<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.我使用的是 BIRT 2.0.0,由于某种原因,它在 pdf 上没有正确地使用 output 希伯来语字符。 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.我升级到最新版本(3.7)并通过 WebViewerExample 进行了测试,我能够生成带有希伯来字符的 pdf。

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.我对 fontsConfig.xml 或设置 ViewerFilter 没有做太多,但这有助于解决我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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