iDempiere ERP: how to configure and run JasperReport ( without input params )

TrablaiDempiere ERP: how to configure and run JasperReport ( without input params ) in iDempiere ERP

iDempiere ERP how to configure and run JasperReport ( without input params )

JasperReports is an open source Java reporting tool that can write to a variety of targets, such as: screen, a printer, into PDF, HTML, Microsoft Excel, RTF, ODT, Comma-separated values or XML files. It can be used in Java-enabled applications, including Java EE or web applications, to generate dynamic content. It reads its instructions from an XML or .jasper file. JasperReports is part of the Lisog open source stack initiative.

JasperReport Official Site - http://community.jaspersoft.com/

iDempiere Business Suite, also known as OSGi + ADempiere, is an open source Enterprise Resource Planning (ERP) software. It has also customer relationship management (CRM) and supply chain management (SCM) functions. It is in contrast to proprietary or most other open source ERP solutions driven only by a community of supporters. iDempiere is a winner of Infoworld's Bossie award for best open source software application, awarded in 2015 and 2016.

iDempiere ERP Official Site - http://www.idempiere.org/

Sponsored by: MM Cargo Services http://www.mmcargoservices.co.za/

In this tutorial we setup and configure JasperReport to execute it in iDempiere  Open Source ERP

Solving:




Watch on YouTube



1. Download and install iReport 6.5.0 from official site:

http://community.jaspersoft.com/project/ireport-designer/releases

iDempiere Java ERP and JasperReport tutorial 1



ATTENTION: NOT LATEST JasperStudio - it won't work !!!! OLD iReport 6.5.0 :) - maybe in future iDempiere devs will fix it



2. Download and install  Java JDK 7 ( yes , old java - it's required by OLD iReport 6.5.0 :)  )
We used following  site, instead of official Oracle, because Oracle forced to register:

http://www.filehorse.com/download-java-development-kit-32/19235/

iDempiere Java ERP and JasperReport tutorial 2

iDempiere Java ERP and JasperReport tutorial 3


3. Run iReport 5.6.0

iDempiere Java ERP and JasperReport tutorial 4

- in iReport 5.6.0 click "File -> New.."

iDempiere Java ERP and JasperReport tutorial 5

- select "Blank A4"
- click "Select this Template"

iDempiere Java ERP and JasperReport tutorial 6

- Report Name - rename to "test-jasper"
- change file location to Desktop

iDempiere Java ERP and JasperReport tutorial 7

- click "Next" button

iDempiere Java ERP and JasperReport tutorial 8


- click "Finish" button

iDempiere Java ERP and JasperReport tutorial 9

iDempiere Java ERP and JasperReport tutorial 10


4. Now let's Setup data-source 
( database connection to iDempiere ERP  Database ) for iReport 5.6.0

- click on Report Datasource button ( see screenshot )

iDempiere Java ERP and JasperReport tutorial 11

- in "Connections / Datasources " dialog window
click "New" button

iDempiere Java ERP and JasperReport tutorial 12

- in "Datasources" dialog window
select  "Database JDBC connection"
click "Next" button

iDempiere Java ERP and JasperReport tutorial 13

iDempiere Java ERP and JasperReport tutorial 14


Use your params, if you installed iDempiere using our tutorial
( https://codingtrabla.blogspot.com/2016/08/install-idempiere-erp-on-windows-7-x64.html )
params will be

- Type Name  -  iDempiere Localhost Database
- JDBC Url   -   jdbc:postgresql://localhost:5432/idempiere
- username     -  adempiere 
- password     -  idempiere123$%
- enable checkbox - Save password


- click "Test" button


iDempiere Java ERP and JasperReport tutorial 15

Hooray !!! Connection Test Successful !!!
Click "OK" button
Click "Save" button

iDempiere Java ERP and JasperReport tutorial 16

click "Close" button

iDempiere Java ERP and JasperReport tutorial 17


5. Now we are ready to set SQL query for report data

- in iReport Report Inspector click on root element "test-jasper"

iDempiere Java ERP and JasperReport tutorial 18

- right mouse click on "test-jasper"  - select "Edit Query"

iDempiere Java ERP and JasperReport tutorial 19

you will see following "Report Query" window

iDempiere Java ERP and JasperReport tutorial 20

type following SQL query -
selects all records and all fields from table ad_user

SELECT  *  FROM  ad_user

and click "OK" button

iDempiere Java ERP and JasperReport tutorial 21


6. Now let's form report in designer

- drag-n-grop  "Static Text" from "Pallete -> Report elements" bar

iDempiere Java ERP and JasperReport tutorial 22


- type following text - "Test JasperReport - All iDempiere Users" 

iDempiere Java ERP and JasperReport tutorial 23

- click on "+" of "Fields" element

iDempiere Java ERP and JasperReport tutorial 24

- drag-n-drop fields "ad_user_id" and "name" to "Detail 1" section

iDempiere Java ERP and JasperReport tutorial 25

iDempiere Java ERP and JasperReport tutorial 26

Increase fonts, change elements placement - make it beautiful !!! :)

iDempiere Java ERP and JasperReport tutorial 28

Hooray !!! Save report, we are ready to put report into iDempiere ERP

7. Login into iDempiere ERP as SuperUser ( default password is System )

iDempiere Java ERP and JasperReport tutorial 29


- set role - "System / System Admin ..."

iDempiere Java ERP and JasperReport tutorial 30


8. In  iDempiere ERP Menu Search field type

Report & Process

and click "New record" button


iDempiere Java ERP and JasperReport tutorial 31

iDempiere Java ERP and JasperReport tutorial 32

- type following values into fields of new record

Name                         -   Test JasperReport - All iDempiere Users


iDempiere Java ERP and JasperReport tutorial 33


Data Access Level    -   All  ( it means - Client + Organization + System, in real world use Client+Organization  )

iDempiere Java ERP and JasperReport tutorial 34




Classname                 - org.compiere.report.ReportStarter

iDempiere Java ERP and JasperReport tutorial 35



JasperReport             -  attachment:test-jasper.jrxml

where test-jasper.jrxml - name of report file we created in  iReport 5.6.0 earlier

iDempiere Java ERP and JasperReport tutorial 36


- Save Record

iDempiere Java ERP and JasperReport tutorial 37




- Add file of report test-jasper.jrxml created in iReport 5.6.0
into record Attachement

- click on Attachment button

iDempiere Java ERP and JasperReport tutorial 38


- load file test-jasper.jrxml
- click ok button

iDempiere Java ERP and JasperReport tutorial 39

iDempiere Java ERP and JasperReport tutorial 40

iDempiere Java ERP and JasperReport tutorial 41

Save and close window record


9.  Now we create iDempiere ERP menu element for our report

- in search field type  - "Menu"

- click on "New Record" button

iDempiere Java ERP and JasperReport tutorial 41

- type following data into new record fields

Name - Test JasperReport iDempiere All Users

iDempiere Java ERP and JasperReport tutorial 42

Action - select "Report"

iDempiere Java ERP and JasperReport tutorial 43

Process  - select "Test JasperReport - All iDempiere Users ... "

iDempiere Java ERP and JasperReport tutorial 44

Click "Save Changes" button

iDempiere Java ERP and JasperReport tutorial 45


10. Now we need to execute "Role Access Update" iDempiere process

- in search field type - Role Access Update
- click on "Role Access Update"

iDempiere Java ERP and JasperReport tutorial 46

- select Client - "System"
- click "Ok" button

iDempiere Java ERP and JasperReport tutorial 47

- click "Close Window" button

iDempiere Java ERP and JasperReport tutorial 48



11. Now we need to execute "Cache Reset" iDempiere ERP process

- in search field type - Cashe
click on "Cache Reset"

iDempiere Java ERP and JasperReport tutorial 49

- click "Ok" button

iDempiere Java ERP and JasperReport tutorial 50

- click "Close Window" button

iDempiere Java ERP and JasperReport tutorial 51


12. Logout / login as SuperUser  

13.  Run our report

- in search field type - Test JasperReport
- click on Test JasperReport All iDempiere Users

iDempiere Java ERP and JasperReport tutorial 52

- click Ok button to run JasperReport in iDempiere

iDempiere Java ERP and JasperReport tutorial 53


Hooray !!! :))))


iDempiere Java ERP and JasperReport tutorial 54



2 comments:

Post a Comment