Difference between revisions of "Creating reports using JasperReports"

From iDempiere en
m (Grammar)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
−
==Introduction==
+
This is a guide to the JasperReports library that is included with iDempiere. The focus is on the standard reporting mechanism, but you can also design more complex reports using JasperSoft Studio as described [[Create reports using JasperSoft Studio|here]].
 +
=Introduction=
 
iDempiere includes the Jaspersoft reporting software library as standard to produce reports in a simple format from many Windows, such as Business Partner Details, Bank/Cash, and so on.  
 
iDempiere includes the Jaspersoft reporting software library as standard to produce reports in a simple format from many Windows, such as Business Partner Details, Bank/Cash, and so on.  
  
 
You can also use the embedded JasperReports engine to generate reports in your own customized format by using JasperSoft Studio to design them.
 
You can also use the embedded JasperReports engine to generate reports in your own customized format by using JasperSoft Studio to design them.
  
−
==Standard Reporting==
+
=Standard Reporting=
−
===Ready-made reports===
+
==Ready-made reports==
 
Many iDempiere Windows include standard, ready-made tabular reports that can be generated from the Report button on the Toolbar (or type Alt-R). Some Windows, for example ''Invoices (Customer)'', also have a Print button (Alt-P) that produces a formatted page.
 
Many iDempiere Windows include standard, ready-made tabular reports that can be generated from the Report button on the Toolbar (or type Alt-R). Some Windows, for example ''Invoices (Customer)'', also have a Print button (Alt-P) that produces a formatted page.
  
Line 16: Line 17:
  
 
Use these ready-made reports as a guide to create your own.
 
Use these ready-made reports as a guide to create your own.
−
===Customise a standard report===
+
==Customise a standard report==
 
You can customise these reports and prints using the Toolbox icon from the print-preview window to change:
 
You can customise these reports and prints using the Toolbox icon from the print-preview window to change:
 
* Add and remove columns;
 
* Add and remove columns;
Line 26: Line 27:
  
 
Once you have made your changes, save the new print format and re-create the print-out.
 
Once you have made your changes, save the new print format and re-create the print-out.
−
===Report Wizard===
+
==Report Wizard==
 
iDempiere also provides a Report Wizard using the Wizard icon which provides more functionality to customise the standard reports, in particular:
 
iDempiere also provides a Report Wizard using the Wizard icon which provides more functionality to customise the standard reports, in particular:
 
* Grouping criteria: group by date or by customer, for example;
 
* Grouping criteria: group by date or by customer, for example;
Line 32: Line 33:
 
* Copy Print Format: make a copy of the standard format of the ready-made reports and then change the format to suit your requirements, leaving the original print format intact.
 
* Copy Print Format: make a copy of the standard format of the ready-made reports and then change the format to suit your requirements, leaving the original print format intact.
  
−
===Create new reports===
+
==Reporting selected records==
−
You can also create your own reports using iDempiere's built-in reporting functionality by creating a Report View for a database table or a more complex database. Follow the [[Report View|guidelines here]].
 
  
−
==Customised reporting==
+
JasperReports can access multiple records selected in an iDempiere window through the T_Selection table. The current process instance available through the AD_PINSTANCE_ID Jasper parameter.
−
===Create new reports using JasperSoft Studio===
 
−
The standard reporting mechanism is suitable for simple reports, but using the built-in Print Format tools to customise layouts and create new reports can be cumbersome and time-consuming.
 
  
−
If you want to create more sophisticated reports and print-outs with professionally designed layouts, fonts, colours and logos, you should rather use JasperSoft Studio to do the design, then load the JRXML report definition into iDempiere.  
+
For queries supporting both individual records and multiple selections, use RECORD_ID for the individual record and T_Selection for the record collection.
  
−
There is a very good guide to the use of JasperSoft Studio in [https://www.youtube.com/watch?v=qupDLprUoJE this video by Evenos], and there is a shorter, word-less [https://www.youtube.com/watch?v=B9mtzNm7CRc video here].
+
See [[Create reports using JasperSoft Studio#Filtering by records selected in iDempiere|Filtering by records selected in iDempiere]] for parameter declarations and SQL examples.
  
−
'''Install JasperSoft Studio'''
+
==Create new reports using built-in reporting functionality==
−
* Download and install the Community Edition of JasperSoft Studio from the [https://community.jaspersoft.com/project/jaspersoft-studio download page] ('''note:''' don't download the older iReport Designer as this has been deprecated in favour of JasperSoft Studio);
+
You can also create your own reports using iDempiere's built-in reporting functionality by creating a Report View for a database table or a more complex database. Follow the [[Report View|guidelines here]].
−
* Follow the installation instructions [https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v640/installing-jaspersoft-studio here]. JasperSoft Studio is built on the same framework as the Eclipse IDE so the [https://community.jaspersoft.com/documentation/v640/tibco-jaspersoft-studio-user-guide installation and usage is the same].
 
  
−
'''Create Data Adapter'''
+
=Customised reporting=
−
* Start up JasperSoft Studio;
+
==Create new reports using JasperSoft Studio==
−
* Delete the two unnecessary Data Adapters (called ''One Empty Record'' and ''Sample DB'');
+
The standard reporting mechanism is suitable for simple reports, but using the built-in Print Format tools to customise layouts and create new reports can be cumbersome and time-consuming.
−
* Create a new Data Adapter to connect to the iDempiere database: '''Create Data Adapter > Database JDBC Connection > Next > '''
 
−
** '''Name:''' iDempiere Data Adapter
 
−
** '''JDBC Driver:''' org.postgresql.Driver
 
−
** '''JDBC URL:''' jdbc:postgresql://localhost:5432/idempiere (use ''localhost'' if the database is on the same machine as JasperSoft Studio, otherwise replace ''localhost'' with the name of the database server);
 
−
** '''Username:''' adempiere (the same username that was used when iDempiere was installed)
 
−
** '''Password:''' *********
 
−
* Click on '''Test''' to test the connection parameters;
 
−
* Click '''Finish''' if all is well.
 
  
−
'''Create JasperReport'''
+
If you want to create more sophisticated reports and print-outs with professionally designed layouts, fonts, colours and logos, you should rather use JasperSoft Studio to do the design, then load the JRXML report definition into iDempiere for execution by the JasperReports engine.
  
 +
Follow these guides:
 +
* [[Create reports using JasperSoft Studio]]
 +
* [https://www.youtube.com/watch?v=qupDLprUoJE Video about JasperSoft Studio by Evenos]
 +
* [https://www.youtube.com/watch?v=B9mtzNm7CRc Short video about JasperSoft Studio].
  
 +
==JasperReports plug-in by Niemcor==
 +
See this [http://youtu.be/JW7WmuknBUo video by Red1] demonstrating a useful JasperReports plug-in by Niemcor, with ready made sample reports. Follow the [[Plugin:_JasperReports|instructions here]].
  
−
 
+
=See also=
−
There is also [http://youtu.be/JW7WmuknBUo a video by Red1] demonstrating a powerful [[Plugin:_JasperReports|plug-in by Niemcor]], with ready made sample reports, that uses OSGi to install the plugin without restarting the server.
 
−
 
 
−
=See Also=
 
 
* [[Making fonts available to your JasperReports]]
 
* [[Making fonts available to your JasperReports]]
 
* [[Finding resources in JasperReports|Making resources such as images and language files available to your JasperReports]]
 
* [[Finding resources in JasperReports|Making resources such as images and language files available to your JasperReports]]
Line 73: Line 65:
 
* [http://www.adempiere.com/HOWTO_Use_Jasper_On_Financial_Reports Another link to historical Compiere documentation about Financial Reports]
 
* [http://www.adempiere.com/HOWTO_Use_Jasper_On_Financial_Reports Another link to historical Compiere documentation about Financial Reports]
  
−
[[Category: System administration]]
 
−
[[Category: System settings]]
 
−
[[Category: Issue (print)]]
 
 
[[Category: JasperReports]]
 
[[Category: JasperReports]]
−
[[Category: HowTo-Technical|J]]
 
−
[[Category: HowTo-Functional|R]]
 
 
[[Category: Development|P]]
 
[[Category: Development|P]]
 
[[Category: Developer documentation‏‎]]
 
[[Category: Developer documentation‏‎]]
−
 
+
[[Category:Reference]]
 +
[[Category: NeedsToBeUpdated]]
  
 
[[en:Creating reports using JasperReports]]  
 
[[en:Creating reports using JasperReports]]  
 
[[es:Crear reportes usando JasperReports]]
 
[[es:Crear reportes usando JasperReports]]

Latest revision as of 19:27, 16 August 2026

This is a guide to the JasperReports library that is included with iDempiere. The focus is on the standard reporting mechanism, but you can also design more complex reports using JasperSoft Studio as described here.

Introduction

iDempiere includes the Jaspersoft reporting software library as standard to produce reports in a simple format from many Windows, such as Business Partner Details, Bank/Cash, and so on.

You can also use the embedded JasperReports engine to generate reports in your own customized format by using JasperSoft Studio to design them.

Standard Reporting

Ready-made reports

Many iDempiere Windows include standard, ready-made tabular reports that can be generated from the Report button on the Toolbar (or type Alt-R). Some Windows, for example Invoices (Customer), also have a Print button (Alt-P) that produces a formatted page.

By default the standard report format includes features like:

  • Zoom across to related documents (e.g. zoom to a Business Partner from the report);
  • Drill down using hyperlinks in HTML reports;
  • Export to HTML, PDF, and Excel.

You can see the full list of ready-made reports by logging in as System/System role, then select Report&Process and execute an advanced query with the filter Report=Yes to select the reports.

Use these ready-made reports as a guide to create your own.

Customise a standard report

You can customise these reports and prints using the Toolbox icon from the print-preview window to change:

  • Add and remove columns;
  • Page format and orientation: A4 Landscape for example;
  • Font: serif or sans serif;
  • Display order of the items on the page;
  • Sort order of the rows or pages;
  • Format of the columns: alignment, width, colour, and so on.

Once you have made your changes, save the new print format and re-create the print-out.

Report Wizard

iDempiere also provides a Report Wizard using the Wizard icon which provides more functionality to customise the standard reports, in particular:

  • Grouping criteria: group by date or by customer, for example;
  • Summary Fields: provides aggregate functions like sum, count, minimum, maximum, mean, variance, and standard deviation;
  • Copy Print Format: make a copy of the standard format of the ready-made reports and then change the format to suit your requirements, leaving the original print format intact.

Reporting selected records

JasperReports can access multiple records selected in an iDempiere window through the T_Selection table. The current process instance available through the AD_PINSTANCE_ID Jasper parameter.

For queries supporting both individual records and multiple selections, use RECORD_ID for the individual record and T_Selection for the record collection.

See Filtering by records selected in iDempiere for parameter declarations and SQL examples.

Create new reports using built-in reporting functionality

You can also create your own reports using iDempiere's built-in reporting functionality by creating a Report View for a database table or a more complex database. Follow the guidelines here.

Customised reporting

Create new reports using JasperSoft Studio

The standard reporting mechanism is suitable for simple reports, but using the built-in Print Format tools to customise layouts and create new reports can be cumbersome and time-consuming.

If you want to create more sophisticated reports and print-outs with professionally designed layouts, fonts, colours and logos, you should rather use JasperSoft Studio to do the design, then load the JRXML report definition into iDempiere for execution by the JasperReports engine.

Follow these guides:

JasperReports plug-in by Niemcor

See this video by Red1 demonstrating a useful JasperReports plug-in by Niemcor, with ready made sample reports. Follow the instructions here.

See also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.