Jasper Report Documentation
Jasper Report Documentation
Jasper Report Documentation
The workflow has been given below with all steps involved and how the Jasper Report has to be created with
snapshots.
Prerequisite :
iReport Installation :
a) Go to iReports folder .
b) Bin --> run ireport sh file. Make sure you have given executable permission.
c) If you wan't to run iReport from command line:
i) cd iReport/bin
ii) sudo chmod 777 ireport
ii) sudo sh ./ireport
Result Obtained:
Now you can see , after clicking on create button, Download template.xml has been created. Download the
xml file.
3 .Open iReport
After entering all the details click on 'Test' button to check the connection (Fig 2)
Snapshots are given below:
Fig 1 Fig 2
6. Create New file by clicking on New --> New File windows opens
Select a Blank template and click on 'Open this template'
Enter the details:
Report name: demo_report1
Location: Give path to custom_reports folder in Jasper Reports module
--> odoo/addons/jasper_reports/custom_reports
File: .jrxml file is created in the custom_reports folder
--> demo_report1.jrxml
7. Resulting View:
8. Click on the Report Query box
9. From the drop down menu 'Query language' , select ---> Xpath
10. On the left hand side you will be able to see all the fields related to ' account.invoice' model listed
11. Select the fields you want in the Report by drag and drop in the
12. Now all the fields have been added. Click 'Ok'
1. Window ---> Palette : this gives all the report elements/ features to enhance report.
2. From the Report Inspector --> Fields will enlist all the selected fields from the accoun.invoice model
3. Drag and drop the fields to the Detail Area of the report.
4. From the Palette, drag 'static text' to enter the Title of the report and 'Image' element to add company
logo or any other image.
13. You can preview the report by clicking on 'Preview'
14. In Odoo:
Settings --> Technical --> Jasper Reports --> Jasper Reports --> Create
Enter the details:
1. Name: name of the report you want to give, this name will be seen in the Odoo 'Print' drop down
2. Report Name: demo_invoice_report
3. Model: account.invoice
4. Files --> Add an item : Here you have select the .jrxml file that has been created by iReport desginer.
5. Save
15. Now go to 'Invoicing' , select the customers in Customer Invoices. In the Print drop down you will find the name of the report we
have created.
For One2Many :
For Many2one :
For Many2one we drag and drop it's fields into our designing report. For Example , if we wan't to display birthday
of my Customer field which is our Many2one field ,so simply i drag birthdat field from my partner_id
(Many2one) and drop it into my report.
Normal Issues encounterd and Solution:
Now in Jasper report when we use float field in report, than report give us float format like 0.000000.
Instead of format 0.00, solution is we change property of that float field from ireport (. jrxml). So follow the
steps
1. Go to ireport.
2. Right click on float field and click on edit expression .
3. Now write there
1. Float.valueOf( $F{ field name} )
2. for example my float field is {Quantity-product_uom_qty} so i am edit it and write
1. Float.valueOf( $F{Quantity-product_uom_qty} )
If above not worked so put in properties
1. text field properties -> Pattern -> custom format is ###0.00
When you wan't to use workers (multi process) in jasper reports in V8 , then you faces errors like
EXCEPTION: [Errno 111] Connection refused (111, 'Connection refused') or
Exception: bus.Bus unavailable .
Solution:
At first install psycogreen python library. And after that uninstall im_chat module from your
database.It's successful worked with workers.
Issues/ Errors encounterd and Solution:
SOLUTION:
1. Open the .jrxml file created and remove uuid attributes.
2. Other solution is simple and effective.
Go to the iReport Designer --> 'Tools' --> 'Options'
General tab --> Compatibility --> In the drop down select 'JasperReports 3.5.1'
Now this will produce .jrxml files without uuid attribute. Issue solved.
2. GroovyEvaluator Error
SOLUTION:
Remove the language = 'groovy' in the .jrxml file
3. Permission denied error
SOLUTION:
Give executable permission to the .jasper and .jrxml files created.
Thank you