`
wuhuizhong
  • 浏览: 684518 次
  • 性别: Icon_minigender_1
  • 来自: 中山
社区版块
存档分类
最新评论

Deploying Jasper Reports In Adempiere

    博客分类:
  • ERP
 
阅读更多

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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics