ADempiere/Compiere JasperReports Integration HowTo

From ADempiere
Revision as of 11:12, 13 December 2006 by Afalcone (Talk)

Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

A bug in our hourly backup script caused our nightly backup to fail, because of this the latest backup is of 26th november 2006. This backup has been restored and editing is back enabled on our wiki. We're sorry for any inconvenience this may cause. --Goanookie 12:04, 12 December 2006 (EST)


The article was lost :(  
I'm rewriting now....  I hope to finish it soon - Thanks - Alejandro


WORK IN PROGRESS - PLEASE DON'T MODIFY

Overview

TODO

Integration with ADempiere is nearly done by Trifon and shall soon be in our future versions.

Preparing ADempiere

The first step that you need is add some field for store the filename of your report, then you will be able to add process for your report and fill the name for each one.

Then come on, start with it!

Start ADempiere

Start ADempiere as with the Java Web Start method (http://adempiere_server:port/adempiere.jnlp) .

Note: You might need a JDK version not a JRE in order to compile the Report.

Login

Login as SuperUser with the System Administrator Role.

JRI Login SuperUser.PNG
JRI Login SystemRole.PNG

Create a new system Element

Open the Element window from Application Dictionary > Element:

JRI Menu Element.PNG
JRI FindRecord Element.PNG

Click the New Element Icon

JRI Element.PNG

Fill the fields and Save.

Database column creation

Go to Table and Column window from Application Dictionary > Table and Column:

JRI FindTable.PNG

Fill the name as Process (quickly access) and press Ok button.

JRI Table&Column.PNG

Select AD_Process and click the Column tab

JRI Table&Column Column.PNG

Add a new Column and change to Data grid toggle. Fill the fields as show the image. 'Save and click Synchronize Column

JRI Synchronize Confirm.PNG

Click OK and note that you have a information: ALTER TABLE…..

JRI Synchronize ALTER.PNG

So it’s OK!

Report & Process window modification

Open the Window, Tab & Field window from Application Dictionary > Window, Tab & Field.

JRI Menu Window.PNG
JRI FindWindow.PNG

Fill the Name for search with Report & Process.

JRI Window.PNG

Click on each tab until the Field tab:

JRI WindowField.PNG

Click the New Record and change to Data grid toggle.

JRI WindowFieldAdded.PNG

Fill and Save.

Ok now you have modified ADempiere. Now we will create a Process to show a sample report.

Process Creation

Simple standalone process creation

In the sample we will create a process called Standalone accessible directly from the main menu. You are logged in as System Administrator role, then go to Report & Process:

JRI Menu Report&Process.PNG
JRI FindReport.PNG

Select New Record...

JRI Report&Process Standalone.PNG

Fill the fields and Save.

Menu Creation

Go to Menu Window, from System Admin > System Rules > Menu

JRI Menu Menu.PNG

Open the Menu Window and Create a new...

JRI Add Menu Standalone.PNG

Fill and Save.

Ok, now Logout and Login again to see the new Process Standalone in the ADempiere main Menu...

Testing the New Process

JRI Main Menu Standalone System.PNG

The file go in $ADEMPIERE_HOME/reports be careful with some Java Web Start installations because if the ADEMPIERE_HOME is not set you might get something like c:\Document And Settings\user\Desktop\null as ADEMPIERE_HOME It is not a problem for testing this you just have to start the process without putting the report you hear a sound marking an error.

JRI Process Confirm Start Standalone.PNG

Just close the window and go to the Tools/preference Menu Select the Errors Tab and you can see exactly where ADempiere is looking for your Report.

JRI StandaloneReport Viewer.PNG

Ok, it’s your Report. Congratulations!

Security Access to new menus

In order to get access to your new Standalone report from your your target Client Role, you need to allow access to process. Then, Login as your client Admin Role:

JRI Login GardenAdm.PNG

Go to Role window:

JRI Menu Role.PNG

and open the window...

JRI Role ProcessAccess.PNG

Add a role accessing your process in the Process Access Tab and Save.

Exit from ADempiere and Login again.

JRI MainMenu Standalone GW.PNG

Ok, it’s done!.

Report deployement Strategy

It is now easy to deploy reports in $ADEMPIERE_HOME/reports or directly on a web server. Just specify the full URL in the Report & Process/JasperReport field and the report wil be downloaded from the web server. Note that the source jrxml is automatically stored in the local temp directory and replaced if a new version is present on the server. Note also that the compiled version is also kept in the temp directory so the compilation is only done one time.

Deploy reports on the application server

It is probably the best method for deploying reports. You need to create a package containing your report. The best way is to create an EAR deployement package and put it in the jboss/server/adempiere/deploy directory of the application server. Jboss will detect that you add a package and deploy it automatically, if you remove it removes.

You can find on svn sourceforge a webApp.ear package wich include standalone.jrxml report deployed as

http://adempiereservename.domain/webApp/standalone.jrxml, or as
http://adempiereservename.domain:adempierewebport/webApp/standalone.jrxml, if web port is other than 80

Tips

TODO

  • Stored Procedures: You need use a Jasper Report with Stored Procedures, but Jasper Reports is unable to call Oracle stored procedures directly......, here is a HowTo.
  • iReport version:
 2006-08-25 08:36:42,046 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.2 

(build: CVSTag=JBoss_4_0_2 date=200505022023)] Started in 1m:37s:500ms

 2006-08-25 08:38:30,156 DEBUG [org.jboss.ejb.StatelessSessionContainer] Useless invocation of remove() for stateless session bean
 2006-08-25 08:39:05,406 INFO [STDOUT] java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 10200, local class serialVersionUID = 608
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
 2006-08-25 08:39:05,406 INFO [STDOUT] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
 ....... and more... 



  • Problem with subreports