<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_create_a_Report_with_iReport</id>
	<title>How to create a Report with iReport - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.infinite-erp.co.id/index.php?action=history&amp;feed=atom&amp;title=How_to_create_a_Report_with_iReport"/>
	<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_a_Report_with_iReport&amp;action=history"/>
	<updated>2026-04-06T15:21:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.infinite-erp.co.id/index.php?title=How_to_create_a_Report_with_iReport&amp;diff=2760&amp;oldid=prev</id>
		<title>Wikiadmin: Created page with &quot;== Objetive == The goal of this how to is to describe the steps required to create a new report in Openbravo 3. The example explained is a simple report with a list of product...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.infinite-erp.co.id/index.php?title=How_to_create_a_Report_with_iReport&amp;diff=2760&amp;oldid=prev"/>
		<updated>2021-12-16T03:11:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Objetive == The goal of this how to is to describe the steps required to create a new report in Openbravo 3. The example explained is a simple report with a list of product...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Objetive ==&lt;br /&gt;
The goal of this how to is to describe the steps required to create a new report in Openbravo 3. The example explained is a simple report with a list of products.&lt;br /&gt;
&lt;br /&gt;
{{(!)|Note: iReport was the recommended design client before PR15Q3. Since PR15Q3 Jaspersoft Studio is the recommended report designer. Go [http://wiki.openbravo.com/wiki/How_to_create_a_Report here] to know how to create a Report using Jaspersoft Studio.}}&lt;br /&gt;
&lt;br /&gt;
== Acknowledgments ==&lt;br /&gt;
Before starting make sure that you have read the [[Prerequisite Knowledge|prerequisite knowledge]] article. And you are confident with Openbravo [[Modularity_Concepts|modularity concepts]]&lt;br /&gt;
&lt;br /&gt;
== Setting up iReport ==&lt;br /&gt;
You need to download iReport, a graphical tool that allows you create and modify JasperReports templates (.jrxml files).&lt;br /&gt;
* Download [http://sourceforge.net/projects/ireport/files/iReport/iReport-4.0.1/ iReport 4.0.1]&lt;br /&gt;
* On Linux: just download the .tar.gz or .zip file and uncompress it, execute the binary &amp;lt;pre&amp;gt;bin/ireport&amp;lt;/pre&amp;gt;&lt;br /&gt;
* On Windows: Download and execute the .exe file&lt;br /&gt;
&lt;br /&gt;
=== Configuring iReport ===&lt;br /&gt;
Some properties of iReport need to be modified in order to work properly. This configuration settings is explained in [[Reports#iReport_Configuration|iReport configuration]]&lt;br /&gt;
In short, you need to make sure:&lt;br /&gt;
* You modified the JasperReport property ''net.sf.jasperreports.awt.ignore.missing.font'' and set it to '''true'''&lt;br /&gt;
* '''Not''' use any '''Scriplet''' class&lt;br /&gt;
* Use '''Java''' as default expression language&lt;br /&gt;
&lt;br /&gt;
=== Setting up Classpath ===&lt;br /&gt;
* Open from the menu options: ''Tools &amp;gt; Options''&lt;br /&gt;
* Move to '''Classpath''' tab&lt;br /&gt;
* Click '''Add Jar''' button&lt;br /&gt;
* Go to your Openbravo sources folder. Under '''lib/runtime''' folder, search for '''postgresql*jdbc*.jar''' and pick it.&lt;br /&gt;
* Click '''OK'''&lt;br /&gt;
&lt;br /&gt;
[[Image:ireport-classpath.png|350px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Defining a Database Connection ===&lt;br /&gt;
* Click the Report Datasources icon [[Image:ireport-report-datasources-button.png]]&lt;br /&gt;
* Click '''New'''&lt;br /&gt;
* Pick '''Database JDBC Connection''' and click ''Next''&lt;br /&gt;
* Fill all the fields&lt;br /&gt;
** '''Name:''' openbravo (or any name you like, e.g. pi)&lt;br /&gt;
** '''JDBC Driver:''' PostgreSQL (org.postgresql.Driver)&lt;br /&gt;
** '''Server Address:''' your database server address, e.g. localhost&lt;br /&gt;
** '''Database:''' pi (or the name of your database)&lt;br /&gt;
** '''Username:''' tad (you can check your username/password in [[Openbravo.properties]] configuration file)&lt;br /&gt;
** '''Password:''' tad&lt;br /&gt;
* Click Wizzard button to generate the JDBC URL&lt;br /&gt;
* Test your connection&lt;br /&gt;
* Save&lt;br /&gt;
[[Image:ireport-database-connection.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
== Creating the Template ==&lt;br /&gt;
* '''File''' &amp;gt; '''New''' &lt;br /&gt;
* Pick '''Report'''&lt;br /&gt;
* Click '''Launch Report Wizzard'''&lt;br /&gt;
[[Image:ireport-new-file.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
* Define a Report Name&lt;br /&gt;
* Define the file Location. Notice that your .jrxml template must be placed under the src folder of your module. More information on the [[Development_Project_Structure#modules|project folder structure]]. A common convention is to place your reports in a ad_reports folder, e.g. modules/org.your.java.package/src/org/your/java/package/ad_reports. This is a convention, not a requirement, but you need to remember where you placed your template.&lt;br /&gt;
[[Image:ireport-new-file-location.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
* Define the query to extract the data&lt;br /&gt;
* Pick the report datasource previously defined&lt;br /&gt;
* The products are stored in the M_Product table &amp;lt;source lang=&amp;quot;sql&amp;quot;&amp;gt;SELECT m_product_id, value, name FROM m_product&amp;lt;/source&amp;gt;&lt;br /&gt;
* Click Next&lt;br /&gt;
[[Image:ireport-define-query.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
* iReport define the fields based on your query&lt;br /&gt;
* Pick all the fields&lt;br /&gt;
* Click Next&lt;br /&gt;
[[Image:ireport-define-fields.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
* Rember to clear the Scriptlet class and modify the Language for expressions&lt;br /&gt;
* '''Window''' &amp;gt; '''Report Inspector'''&lt;br /&gt;
* In the report properties in the right, scroll down to More section&lt;br /&gt;
** Clear the Scriptlet class&lt;br /&gt;
** Choose Java as Language&lt;br /&gt;
* Save your changes&lt;br /&gt;
[[Image:ireport-report-property-language.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
* Put a static text as report title: ''Product List''&lt;br /&gt;
* Place the fields in the '''Detail''' band and a title in the '''Column Header''' band&lt;br /&gt;
* Save your changes&lt;br /&gt;
[[Image:ireport-detail-band.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Click the '''Preview''' button to get a report preview&lt;br /&gt;
[[Image:ireport-sample-output.png|300px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
{{(!)|Note: It is recommended to use Dejavu fonts in jasper reports because this fonts support most of the characters in almost all languages​​. Besides, Dejavu typography is the family of fonts that Openbravo included in jasperreports-fonts library.}}&lt;br /&gt;
&lt;br /&gt;
== Registering the Report in Application Dictionary ==&lt;br /&gt;
&lt;br /&gt;
=== Creating the Report ===&lt;br /&gt;
* Using the System Administrator role&lt;br /&gt;
* Using the quick-launch, open: '''Report and Process''' window &lt;br /&gt;
** You can find it in the menu: Application Dictionary &amp;gt; Report and Process&lt;br /&gt;
&lt;br /&gt;
* Create a new record&lt;br /&gt;
* Fill all required fields&lt;br /&gt;
** '''Module:''' Pick your module&lt;br /&gt;
** '''Search Key:''' SMPLRProductList (Is a best practice to start with your module's [[Modularity_Concepts#DB_Prefix|DB_Prefix]])&lt;br /&gt;
** '''Name:''' Product List&lt;br /&gt;
** '''Data Access Level:''' Client/Organization&lt;br /&gt;
** '''UI Pattern:''' Standard&lt;br /&gt;
** '''Jasper Report:''' Check&lt;br /&gt;
** '''JR Template name''': &amp;lt;pre&amp;gt;@basedesign@/org/openbravo/examples/report/ad_reports/ProductList.jrxml&amp;lt;/pre&amp;gt;&lt;br /&gt;
*** ''@basedesign@'' is a '''constant''' that you '''must''' use always, after that, starting with a slash you need to write the path to your jrxml template.&lt;br /&gt;
{{(!)|Note: Report checkbox must be unchecked}}&lt;br /&gt;
&lt;br /&gt;
[[Image:add-report.png|600px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
=== Creating the Menu record ===&lt;br /&gt;
* Using the System Administrator role&lt;br /&gt;
* Open the Menu window&lt;br /&gt;
* Create a new record&lt;br /&gt;
* Fill all required fields:&lt;br /&gt;
** '''Module:''' Your module&lt;br /&gt;
** '''Name:''' Name of the menu entry (Product List)&lt;br /&gt;
** '''Description:''' You must enter a description. Although is not mark as required, it is for this type of reports&lt;br /&gt;
** '''Action:''' Pick Process&lt;br /&gt;
** '''Process:''' Pick your process (Product List)&lt;br /&gt;
&lt;br /&gt;
[[Image:add-menu-entry.png|600px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
== Compiling ==&lt;br /&gt;
&lt;br /&gt;
After you have registered the report and menu entry in the Application Dictionary, you need to compile to generated the the necessary code.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;ant smartbuild&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the compilation has completed, refresh your [[How_to_setup_Eclipse_IDE|Eclipse project]], and restart your tomcat server.&lt;br /&gt;
&lt;br /&gt;
== Testing the Report ==&lt;br /&gt;
If you have completed all the steps, you should be able to open your Product List report form the quick-lauch, or menu entry.&lt;br /&gt;
&lt;br /&gt;
[[Image:final-product-list.png|600px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further Details ==&lt;br /&gt;
=== Layout ===&lt;br /&gt;
For information on how JasperReports handles the layout check [http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html#FAQ9 Making HTML, XLS or CSV friendly reports]&lt;br /&gt;
&lt;br /&gt;
== Creating a Report Using a Process Definition ==&lt;br /&gt;
{{(!)| This feature is available from '''3.0PR15Q2'''}}&lt;br /&gt;
&lt;br /&gt;
From '''3.0PR15Q2''' it is possible to create a report using a process definition. For more info see [http://wiki.openbravo.com/wiki/How_to_create_a_Report_using_Process_Definition here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Wikiadmin</name></author>
		
	</entry>
</feed>