我在用iReport生成pdf文件的时候碰见了如下问题:主要是参数显示不出来
Exporting PDF (using iText) to file... C:\Users\gubin\Desktop\指导教师对博士学位论文的学术评语.pdf!
Error exporting print... UniGB-UCS2-H
ExceptionConverter: java.io.UnsupportedEncodingException: UniGB-UCS2-H at java.lang.StringCoding.encode(StringCoding.java:269) at java.lang.String.getBytes(String.java:947) at com.lowagie.text.pdf.PdfEncodings.convertToBytes(Unknown Source) at com.lowagie.text.pdf.TrueTypeFont.<init>(Unknown Source) at com.lowagie.text.pdf.TrueTypeFont.<init>(Unknown Source) at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source) at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source) at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1829) at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk
网上说是没加包,但是我已配置上去 iTextAsian.jar
Styles设置也没问题有的加入简单Style的也能显示出来参数。配置复杂参数的就会报如上错误。。
求解
Exporting PDF (using iText) to file... C:\Users\gubin\Desktop\指导教师对博士学位论文的学术评语.pdf!
Error exporting print... UniGB-UCS2-H
ExceptionConverter: java.io.UnsupportedEncodingException: UniGB-UCS2-H at java.lang.StringCoding.encode(StringCoding.java:269) at java.lang.String.getBytes(String.java:947) at com.lowagie.text.pdf.PdfEncodings.convertToBytes(Unknown Source) at com.lowagie.text.pdf.TrueTypeFont.<init>(Unknown Source) at com.lowagie.text.pdf.TrueTypeFont.<init>(Unknown Source) at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source) at com.lowagie.text.pdf.BaseFont.createFont(Unknown Source) at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:1829) at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk
网上说是没加包,但是我已配置上去 iTextAsian.jar
Styles设置也没问题有的加入简单Style的也能显示出来参数。配置复杂参数的就会报如上错误。。
求解
解决方案 »
- JAR如何独立运行
- 【高手请进】关于JAVAEE 6中slf4j冲突,绑定Log4j失败,求解决方案
- 如何绘制一个曲线图显示在jsp页面。
- struts2上传文件,怎么获取文件的后缀名
- 遍历Alist,将Alist中的对象中的Blist放入select中的list 怎么写
- 为什么我的applet走到这里不往下执行了?
- struts2如何在action中向succeed.jsp传递参数
- 急!!!Spring+hibernate连接ORACLE,有查询SQL,但是没有结果?
- 如何得到本周的周一和周七的日期?
- 运行runclient时报错No application client descriptors defined for:accountClient,为什么
- Struts2 问题:严重: Exception starting filter struts2
- 问题错在哪里?
呵呵!我在对$P{}绑定Style的时候,中间删了一次$P{},然后又加上了,只不过加上之后出现异常也就是上面所提到的我重新写了页面才好使的。也就是说$P{}绑定Style之后不能删了在创建$P{},否则转化成pdf文件时值转码会出现问题