目录
1、Font '仿宋_GB2312' is not available to the JVM
3、jasperreport使用过程中会生成中间java文件,如何查看这些文件
1、Font '仿宋_GB2312' is not available to the JVM
Caused by: net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '仿宋_GB2312' is not available to the JVM. See the Javadoc for more details.
这是由于linux上装的JRE没有仿宋字体造成的,可通过如下方式获取JRE支持那些字体:
String[] familyNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
一般SUSE Linux下JRE支持的字体:
Albany AMT
Andale Sans
Andy MT
Arial Black
Bell MT
Bitstream Charter
Bitstream Vera Sans
Bitstream Vera Sans Mono
Bitstream Vera Serif
Century Schoolbook L
Courier
Courier 10 Pitch
CourierThai
Cumberland AMT
Cursor
DejaVu Sans
DejaVu Sans Condensed
DejaVu Sans Light
DejaVu Sans Mono
DejaVu Serif
DejaVu Serif Condensed
Dialog
DialogInput
Dingbats
Goha-Tibeb Zemen
Hershey
Impact
Lucida Bright
Lucida Sans
Lucida Sans Typewriter
Luxi Mono
Luxi Sans
Luxi Serif
Monospaced
Monotype Sorts
Nimbus Mono L
Nimbus Roman No9 L
Nimbus Sans L
SansSerif
Serif
Standard Symbols L
Thonburi
Thorndale AMT
URW Bookman L
URW Chancery L
URW Gothic L
URW Palladio L
Utah MT
Utopia
文鼎PL简中楷
文鼎PL简报宋
方正仿宋
方正宋体
方正楷体
方正黑体
2、jasperreport中一些重要的属性
isStretchWithOverflow="true" 当单元格中的内容超出了单元格的大小时,是否将单元格拉大
isBlankWhenNull="true" 当单元格中的内容为null时,是否显示成空单元格
stretchType="RelativeToTallestObject" 沿垂直方向拉大单元格
isPrintWhenDetailOverflows="false" 上一页的最后一条记录是否要在当前页重复显示
pattern="#,##0.00 数字以千分位分隔
isPrintRepeatedValues="true" 默认为true,当列中有连续相同的值时,是否将除第一个以外的其它相同的值也显示出来
3、jasperreport使用过程中会生成中间java文件,如何查看这些文件
-Djasper.reports.compile.keep.java.file=true
-Djasper.reports.compile.temp=E:/workspace_BEMC/logs/appb
这些参数是从如下类中加载的:
net.sf.jasperreports.engine.DefaultJasperReportsContext
4、jasperReport中jrxml文件的相关设置
isStretchWithOverflow="true" # 单元格中的内容较长时不截断其中的内容
stretchType="RelativeToTallestObject" # 单元格中的内容较长时能自动换行并从垂直方向撑大单元格
verticalAlignment="Middle" # 单元格中的内容垂直居中
isBlankWhenNull="true" # 单元格中的内容为空时填充空格