Difference between revisions of "Using Jasper Report Form in place of Standard Forms"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(How ADempiere locate Forms for each document type)
Line 4: Line 4:
 
Jasper Report is adopted as more flexible and easy way to create reports. Without it, we need to create Forms or Reports using ADempiere's Print Format. In some case, it is ok, but many cases quite difficult to use.
 
Jasper Report is adopted as more flexible and easy way to create reports. Without it, we need to create Forms or Reports using ADempiere's Print Format. In some case, it is ok, but many cases quite difficult to use.
  
There are many pages in this Wiki talking about how to user Jasper Report, which will be very informative to read. To be more specific, this page will give the overview with pictures how to use Jasper Report as a Form, i.e., Invoice, Receipt, etc.
+
There are many pages in this Wiki talking about how to user Jasper Report, which will be very informative to read. To be more specific, this page will give the overview with pictures how to use Jasper Report as a Form, i.e., Sales Order, Invoice, Receipt, etc.
 +
 
 +
By default, clicking on Print Preview in document window menu give, '''Sales Order Form''' generated by Print Format technique.
 +
 
 +
[[File:standard_so.jpg|250px|Sample Standard Order From]]
 +
 
 +
==First - know how ADempiere locate Forms for each document type==
 +
 
 +
Wondering, how Print Preview button discover which Form to use? Here is the answer,
  
==How ADempiere locate Forms for each document type==
 
 
Before the integration with Jasper Report, '''Print Format''' is the only way to create Print Form in ADempiere. As such, in the window that do the Form & Document mapping is using the Print Format to tell what form to use for which document type. This give some confusion at first, but we will see how jasper report form will be used on top of it later.   
 
Before the integration with Jasper Report, '''Print Format''' is the only way to create Print Form in ADempiere. As such, in the window that do the Form & Document mapping is using the Print Format to tell what form to use for which document type. This give some confusion at first, but we will see how jasper report form will be used on top of it later.   
  
Line 16: Line 23:
  
 
[[File:document_type.jpg|500px|Document Type]]
 
[[File:document_type.jpg|500px|Document Type]]
 +
  
 
*You can right click on the Print Format field and Zoom to Print Format window to see them in detail.  
 
*You can right click on the Print Format field and Zoom to Print Format window to see them in detail.  
 +
*Note that, by default, Jasper Report field is blank, which mean this Print Format is used directly as Printing Form
  
'''Sample of Sales Order Form is as following,'''
+
[[File:print_format.jpg|500px|Print Format]]
  
[[File:standard_so.jpg|250px|Sample Standard Order From]]
+
*Although we can use Print Format to customize this form using its Format Item tab, but trust me, it is the most time consuming work to do with ADempiere. '''Let's make our life easier with Jasper Report!'''
 +
 
 +
;Summary on how Print Preview button on document window find Print Format to use
 +
*'''Purchase Order and Sales Order:''' "Document Type" overwrite "Print Form"
 +
*'''Invoice (Customer) and Invoice (Vendor):''' "Business Partner / Customer tab (Invoice Print Format)" overwrite "Document Type" overwrite "Print Form"
 +
*'''Shipment (Customer) and Material Receipt:''' "Document Type" overwrite "Print Form"
 +
*'''Payment:''' This type of document is a bit special, as it will be looking the Print Format from "Bank / Bank Account Document tab (Check Print Format)". In Payment window, based on selected Bank Account, right Print Format will be used.
 +
 
 +
==Creating new Jasper Report Form and use it in place of the Print Format==
 +
 
 +
Assuming that we already know how to use Jasper Report to create a form, the only trick is to ensure your Jasper Report will use '''$P{RECORD_ID}''' parameter to get ID from the calling window.
 +
 
 +
[[File:jasper_so.jpg|500px|Jasper Sales Order]]
 +
 
 +
'''Note:'''
 +
*In most window, RECORD_ID is the real current record of the calling window. I.e., Sales Order = C_Order_ID, but not always.
 +
*Some window, such as Payment, is passing C_PaySelectionCheck_ID not C_Payment_ID.
 +
 
 +
After ensure that the Jasper Report running fine, [http://www.adempiere.com/index.php/ADempiere/Compiere_JasperReports_Integration_HowTo#Report_deployment_Strategy deploy report] and then register this Jasper Report to ADempiere
 +
#As System, create new record and tell where this report is located
 +
 
 +
[[File:report_and_process.jpg|500px|Register Jasper Report]]
 +
 
 +
#As Client, use this Jasper Report in the Print Format in question, i.e., following picture is for Sales Order Form
 +
 
 +
[[File:jasper_on_printformat.jpg|500px|Use created Jasper Report on Sales Order Form]]
  
Although we can use Print Format to customize this form, but trust me, it is the most time consuming work to do with ADempiere. '''Let's make our life easier with Jasper Report!'''
+
'''Note as of 360LTS'''
 +
*It is recommended to use jasper report to overwrite the default print format, rather than creating new print format just for it. Although you might notice that, the overwritten default print format configuration is not used at all.
 +
*The reason is, Jasper Report is just overwriting. Internally, the report engine still execute the overwritten print format although not used eventually. It can give non-fatal log message if, i.e., not found the Format Items records, or pass RECORD_ID that is unmatched with the Print Format's Table.
 +
*Or if it is necessary, make sure you create with the right table and click on "Copy/Create" button to create some Format Item records (just to avoid error).
  
==Creating new Jasper Report Form and passing the right parameter==
 
 
==Number to Text in Jasper Form (Thai Language)==
 
==Number to Text in Jasper Form (Thai Language)==
 
==Registering Jasper Form==
 
==Registering Jasper Form==
Line 31: Line 67:
 
== See Also ==
 
== See Also ==
 
*[[ADempiere/JasperReports Integration HowTo]]
 
*[[ADempiere/JasperReports Integration HowTo]]
'''Bold text'''
 
  
 
[[Category:Projects and Tools]]
 
[[Category:Projects and Tools]]

Revision as of 02:10, 28 September 2010

This content contributed by Ecosoft, Thailand.

Overview

Jasper Report is adopted as more flexible and easy way to create reports. Without it, we need to create Forms or Reports using ADempiere's Print Format. In some case, it is ok, but many cases quite difficult to use.

There are many pages in this Wiki talking about how to user Jasper Report, which will be very informative to read. To be more specific, this page will give the overview with pictures how to use Jasper Report as a Form, i.e., Sales Order, Invoice, Receipt, etc.

By default, clicking on Print Preview in document window menu give, Sales Order Form generated by Print Format technique.

Sample Standard Order From

First - know how ADempiere locate Forms for each document type

Wondering, how Print Preview button discover which Form to use? Here is the answer,

Before the integration with Jasper Report, Print Format is the only way to create Print Form in ADempiere. As such, in the window that do the Form & Document mapping is using the Print Format to tell what form to use for which document type. This give some confusion at first, but we will see how jasper report form will be used on top of it later.

  • For most Document Type, Print Form window will be used as default, Some exception will be discussed later.

Print Form

  • To overwrite it to be more specific for different Document Type, use window Document Type, field Print Format

Document Type


  • You can right click on the Print Format field and Zoom to Print Format window to see them in detail.
  • Note that, by default, Jasper Report field is blank, which mean this Print Format is used directly as Printing Form

Print Format

  • Although we can use Print Format to customize this form using its Format Item tab, but trust me, it is the most time consuming work to do with ADempiere. Let's make our life easier with Jasper Report!
Summary on how Print Preview button on document window find Print Format to use
  • Purchase Order and Sales Order: "Document Type" overwrite "Print Form"
  • Invoice (Customer) and Invoice (Vendor): "Business Partner / Customer tab (Invoice Print Format)" overwrite "Document Type" overwrite "Print Form"
  • Shipment (Customer) and Material Receipt: "Document Type" overwrite "Print Form"
  • Payment: This type of document is a bit special, as it will be looking the Print Format from "Bank / Bank Account Document tab (Check Print Format)". In Payment window, based on selected Bank Account, right Print Format will be used.

Creating new Jasper Report Form and use it in place of the Print Format

Assuming that we already know how to use Jasper Report to create a form, the only trick is to ensure your Jasper Report will use $P{RECORD_ID} parameter to get ID from the calling window.

Jasper Sales Order

Note:

  • In most window, RECORD_ID is the real current record of the calling window. I.e., Sales Order = C_Order_ID, but not always.
  • Some window, such as Payment, is passing C_PaySelectionCheck_ID not C_Payment_ID.

After ensure that the Jasper Report running fine, deploy report and then register this Jasper Report to ADempiere

  1. As System, create new record and tell where this report is located

Register Jasper Report

  1. As Client, use this Jasper Report in the Print Format in question, i.e., following picture is for Sales Order Form

Use created Jasper Report on Sales Order Form

Note as of 360LTS

  • It is recommended to use jasper report to overwrite the default print format, rather than creating new print format just for it. Although you might notice that, the overwritten default print format configuration is not used at all.
  • The reason is, Jasper Report is just overwriting. Internally, the report engine still execute the overwritten print format although not used eventually. It can give non-fatal log message if, i.e., not found the Format Items records, or pass RECORD_ID that is unmatched with the Print Format's Table.
  • Or if it is necessary, make sure you create with the right table and click on "Copy/Create" button to create some Format Item records (just to avoid error).

Number to Text in Jasper Form (Thai Language)

Registering Jasper Form

See Also