出错信息主要是:ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H
还有:dori.jasper.engine.JRException: Could not load the following font :
pdfFontName : Helvetica
pdfEncoding : Identity-H
isPdfEmbedded : false
另外,小弟跪求TheJasperReportsUltimateGuide.1.0.pdf,若哪位肯出手相赠,愿再奉上50分(不好意思,现在总共就100分了,请海涵)。email: neuzq@163.com
详细出错信息如下:
E:\JBuilderX\jdk1.4\bin\javaw -classpath "E:\JBuilderX\thirdparty\jakarta-tomcat-4.1.27-LE-jdk14\bin\bootstrap.jar;E:\JBuilderX\jdk1.4\lib\tools.jar" -Dcatalina.home="E:/JBuilderX/thirdparty/jakarta-tomcat-4.1.27-LE-jdk14" org.apache.catalina.startup.Bootstrap -config E:\ReportTest\Tomcat\conf\server8080.xml start
2004-8-2 21:52:04 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.27-LE-jdk14
HostConfig[localhost]: Deploying configuration descriptor jb-webapps.xml
WebappLoader[/webapps]: Deploying class repositories to work directory E:\ReportTest\Tomcat\work\webapps
信息: Starting Coyote HTTP/1.1 on port 8080
ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H
at sun.io.Converters.getConverterClass(Converters.java:215)
at sun.io.Converters.newConverter(Converters.java:248)
at sun.io.CharToByteConverter.getConverter(CharToByteConverter.java:64)
at java.lang.StringCoding.encode(StringCoding.java:370)
at java.lang.String.getBytes(String.java:573)
at dori.jasper.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1294)
....................................
NESTED BY :
ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H
at sun.io.Converters.getConverterClass(Converters.java:215)
at sun.io.Converters.newConverter(Converters.java:248)
at sun.io.CharToByteConverter.getConverter(CharToByteConverter.java:64)
..........................................
Caused by: ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H
------解决方法--------------------------------------------------------
the itext asia package support one Simplified Chinese font (STSong-Light) and two
Traditional Chinese (MHei-Medium,
MSung-Light), but we can register new chinese font at jasperreport .
such as:
<reportFont name="simkai" isDefault="false" fontName="Arial" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="simkai.ttf" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
you must keep the font file "simkai.ttf" at your classpath. or you can give a fullpath at here two.