Deploying Jasper Reports In Adempiere

Following are some conditions to meet
=========================
1. Reports have sub-reports or image
2. Reports have new fonts that was not originally exists
3. Server is Linux (and Windows)
4. Client is both Swing and Webui, on both Linux and Windows (as such, fonts must work for both)
5. Easy to deploy new reports

After many tries and wiki readings, there are many ways to deploy it, but most ways works for some condition and not others.

Following are what I think work best (at least for me) in most condition.

Deploy new fonts
============
1. Jar all new fonts into, i..e, Fonts.jar.
2. Deploy as new package in Adempiere. I..e, %ADEMPIERE_HOME%/packages/Fonts/lib/Fonts.jar
3. Execust RUN_silentsetup.bat (.sh), this will make sure it will be availabe through both WebUI and also when deploy as WebStart (swing)

Jasper Report Deployment
===================
1. Create a folder in Server (a folder not a file!) %ADEMPIERE_HOME%/jboss/server/adempiere/deploy/reports.war
2. Copy all jasper files, related images into this folder &quot;reports.war&quot;. Without having to restart jboss, all these reports will be availabe in path http://<server>:8080/reports/<jasper files>.
3. In Report & Process window of ADempiere, Jasper field, specify path to the report using the URL, i.e., http://<server>:8080/reports/MyReport.jasper. Make sure you use .jasper, not .jrxml.
4. If you have new report, just copy the file into this folder and it should be available immediatelly.

Note when design jasper:
--> Make sure that during design time, you can save to pdf and the font still display correctly. This is important, as it will make sure that new font will display correctly in boht WebUI and Swing client (when export to PDF). Read more about PDF here .

--> If the report has sub report or link to images, do use the URL to link the image, i.e., http://<server>:8080/reports/Logo.gif. Jasper will look up only for Logo.gif during design time. (if you don't specify as URL, Linux Server will not be able to find the correct image path).

Start the Application Server. Now report should be available in both WebUI and Swing, in any OS.

** Some note on why other approach don't work: **
--> Deploy as attachment --> Case report with image link, Work in Windows, not work in Linux
--> Deploy at %ADEMPIERE_HOME%/reports --> Work in WebUI, but not deployed into client via WebStart.

 

Where to place JasperReport files?

JasperReport can be defined as:

http://
https://
attachment:
file:/ 
or a direct file_directory path 

An easier way to deploy jasper reports could be putting the .jasper in the customization.jar

For that we could add a new prefix like:

resource:org/adempiere/jasper/MyReport.jasper
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值