Trabla: iDempiere ERP: how to configure and run JasperReport ( without input params ) in iDempiere ERP
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
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/
3. Run iReport 5.6.0
- in iReport 5.6.0 click "File -> New.."
- select "Blank A4"
- click "Select this Template"
- Report Name - rename to "test-jasper"
- change file location to Desktop
- click "Next" button
- click "Finish" button
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 )
- in "Connections / Datasources " dialog window
click "New" button
- in "Datasources" dialog window
select "Database JDBC connection"
click "Next" button
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
Hooray !!! Connection Test Successful !!!
Click "OK" button
Click "Save" button
click "Close" button
5. Now we are ready to set SQL query for report data
- in iReport Report Inspector click on root element "test-jasper"
- right mouse click on "test-jasper" - select "Edit Query"
you will see following "Report Query" window
type following SQL query -
selects all records and all fields from table ad_user
SELECT * FROM ad_user
and click "OK" button
6. Now let's form report in designer
- drag-n-grop "Static Text" from "Pallete -> Report elements" bar
- type following text - "Test JasperReport - All iDempiere Users"
- click on "+" of "Fields" element
- drag-n-drop fields "ad_user_id" and "name" to "Detail 1" section
Increase fonts, change elements placement - make it beautiful !!! :)
Hooray !!! Save report, we are ready to put report into iDempiere ERP
7. Login into iDempiere ERP as SuperUser ( default password is System )
- set role - "System / System Admin ..."
8. In iDempiere ERP Menu Search field type
Report & Process
and click "New record" button
- type following values into fields of new record
Name - Test JasperReport - All iDempiere Users
Data Access Level - All ( it means - Client + Organization + System, in real world use Client+Organization )
Classname - org.compiere.report.ReportStarter
JasperReport - attachment:test-jasper.jrxml
where test-jasper.jrxml - name of report file we created in iReport 5.6.0 earlier
- Save Record
- Add file of report test-jasper.jrxml created in iReport 5.6.0
into record Attachement
- click on Attachment button
- load file test-jasper.jrxml
- click ok button
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
- type following data into new record fields
Name - Test JasperReport iDempiere All Users
Action - select "Report"
Process - select "Test JasperReport - All iDempiere Users ... "
Click "Save Changes" button
10. Now we need to execute "Role Access Update" iDempiere process
- in search field type - Role Access Update
- click on "Role Access Update"
- select Client - "System"
- click "Ok" button
- click "Close Window" button
11. Now we need to execute "Cache Reset" iDempiere ERP process
- in search field type - Cashe
- click on "Cache Reset"
- click "Ok" button
- click "Close Window" button
12. Logout / login as SuperUser
13. Run our report
- in search field type - Test JasperReport
- click on Test JasperReport All iDempiere Users
- click Ok button to run JasperReport in iDempiere
Hooray !!! :))))
2 comments:
Hello World!
Great tutorial !
Post a Comment