日期:2014-05-18  浏览次数:20702 次

jasper3.7.3 textField与staticText的字体编码问题:新细明体(PMingLiU-TW),繁体字显示成"?",求教jasper报表高手
我现在用的是jasper3.7.3, 对应design工具是ireport3.7.3,编译工具是ant1.8.2。
中文使用繁体字,
1. 使用中文的textField与staticText的各属性分别为:
fontName="Verdana" 
pdfFontName="Helvetica" 
pdfEncoding="Cp1252" 
isPdfEmbedded="false"
2. 使用中文的textField与staticText的各属性分别为:
fontName="PMingLiU-TW" 
pdfFontName="Helvetica" 
pdfEncoding="Cp1252" 
isPdfEmbedded="false"
1. 如果是在中文的XP系统下,编译成jasper后放到项目中产生报表,显示正常
2. 如果是在英文的XP系统下,编译成jasper后放到项目中产生报表,textField中文显示成"?",英文显示正常;staticText中文、英文均显示正常
现有一解决办法,将英文系统的语言设置更改为中文,大部分汉字显示正常,但有部分汉字仍显示为"?"
请问武林高手,还有什么办法解决此问题?
------解决方案--------------------
<jrc destdir="${re.build.report.layout.dir}" keepjava="true">
<src>
<fileset dir="${ps.build.rpt.src.dir}">
<include name="**/*.jrxml" />
</fileset>
</src>
<classpath>
<fileset refid="compile-infslib.path" />
<fileset dir="${build.dist.dir}">
<include name="${project.platform_server.jar}" />
</fileset>
</classpath>
<compilerarg line="-encoding UTF8"/>
</jrc>