iReport is a graphical tool you can use to create/edit templates (jrxml files) that will be later processed by JasperReports engine.
![]() | You must use iReport 4.0.1 |
JasperReports introduced a change in version 3.6.1 that it should fail (throw an exception) when you're trying to use a font that is not available.
JasperReports 3.6.1 (2009-10-26, SVN 3170) --------------------------------------------- - net.sf.jasperreports.awt.ignore.missing.font configuration property added to control font availability verifications during report filling and report AWT rendering;
If you open a JasperReports template and is using a font not available in your system, you won't see the text of label. To avoid this problem you need to configure your iReport to skip this check.
Openbravo 3 doesn't support out of the box any Scriplet class. Make sure your template doesn't contain any class in the template properties.
The default language for expressions in Openbravo 3 is Java. Make sure that your template uses Java as language expression.
原文:http://quicker.iteye.com/blog/801655
使用Ireport最新的4.0.1版本
1、在Ireport加添加数据源Q窗?gt;服务>数据?gt;增加数据?/p>
2、在Ireport4.0.1下实现PDF中文报表Q解决中文字体问题:
下蝲安装根目录如D:\Program Files\iReport-4.0.1Q在其下目录D:\Program Files\iReport-4.0.1\ireport\modules\ext中包括了许多应用所需要的jar文g。打开ireportQ工?gt;选项>iReport>Classpath>在里面添加jarQ添加ext目录下的iText-2.1.7.jar和iTextAsian.jar两个jar;
如图Q?/p>
在工?gt;选项>iReport>fonts下面全?/p>
如图
新徏一个报表,d静态文本,输入中文q设|文本的字体、PDF font name选择STSong-LightQPDF Encoding选择UniGB-UCS2-H。PDF Embedded选上?/p>
讄完成后用pdf preview,因ؓ我们上面新加了jar包,所以最好先关了ireport再重启,之后预览O(jin)K?/p>
3、给报表文本加边框:右键炚w态文?gt;Padding and borders>选择Line width和Line style可以了
4、ireport参数传递,我们可以查询语句作为参敎ͼ通过E序传入参数|也可讄默认?如我新增Parameter名ؓSQLSTR,在属?gt;Default value Expression输入“select * from orders”注意两边加双引号噢。参数徏好了。我们选择Report QueryQ我们本来是在里面输入查询语句的Q这里我们用SQLSTR参数,如下图:$P!{SQLSTR}记得中间有!L。点read Field一栯出属性了?/p>
如下?/p>
5、我们在CZ中看到给报表加注释的情况如下图:
刚开始找了半天没扑ֈq个lgQ虽然没多大用,不过后来扑ֈ了,是ireportlg面板中的Calloutlg了。拖出来点右?gt;dpin有一个图钉一L东东了。?/p>
6、样式的使用Q我们上面对文本框尤其是中文要进行字体还有pdf fontname,{设|,那么整个报表做下来如果每个都要这栯|那肯定是个大麻烦事Q所以这里也使用样式来定义,可以新增styleQƈ讑֮style的相应|那么在其它的文本{需要用同一讄的组件上Q我们只要在它的属性里的style中选定刚创建的stylep了?/p>
7、ؓ报表增加l计|一般统计值放在page footer和summary中。summmary为报表别的l计。以summaryZQ如我们要统计orders 表中的freight字段的值的L?/p>
首先创徏一个变量TOTAL_NUMQ配|如下图Q?/p>
把该变量拖到Summary Band卛_。注意上面配|项的increment type为noneQ另外Reset Type为Report
如果我们在page footer下的l计Q这里的reset Type应设为Page