How to create Report in OpenERP
How to create Report in OpenERP
step 1 :
-------------------------------------------------------------------------------------------------------
→
open open-office.org
→
tools menu
→
extension manager
→
go to - base_report_designer
→
plugin →openerp_report_designer.zip
step 2 :
---------------------------------------------------------------------------------------------------------
→
restart open-office
step 3 :
----------------------------------------------------------------------------------------------------------→
open a new report
→
add a loop ( select your DB)
→
add loop as a repeat
→
add a field and make it customize look
→
save file as a .sxw or send to the server
step 4 :
----------------------------------------------------------------------------------------------------------→
convert .sxw to .rml
→ cd addons/base_report_designer/openerp_sxw2rml
→
$ python openerp_sxw2rml.py
../../exam/report/.sxw > ../../exam/report/.rml
step 5 :
-----------------------------------------------------------------------------------------------------------→
( in report folder )
→
exam.py
or
copy it from
(http://doc.openerp.com/v6.0/developer/3_11_reports/11_1_openoffice_report.html)
import time
from report import report_sxw
class exam(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(exam, self).__init__(cr, uid, name, context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('report.exam.student', 'exam.student',
'addons/exam/report/exam.rml', parser=exam, header=True)
→
(exam.py , exam.rml , exam.sxw , __init__.py )
→
__init__.py
import
exam
step 6 :
------------------------------------------------------------------------------------------------------------
( main exam folder )
→
exam_report.xml
<?xml version="1.0"?>
<openerp>
<data>
<report
id="exam_student"
string="Print Exam..."
model="exam.student"
name="exam.student"
rml="exam/report/exam.rml"
auto="False"
header="False"/>
</data>
</openerp>
-------------------------------------------------------------------------------------------------------------→
__openerp__.py
in update xml add this → 'exam_report.xml'
--------------------------------------------------------------------------------------------------------------
→
__init__.py
import report
-----------------------------------------------------------------------------------------------------------
EDIT : HOW TO Customize thai font with Report Designer Module
if we customize report and send to the server it gonna save to database, file system will be ignore.
- edit report with Report Designer (OpenOffice)
- save sxw file to file system (example/report/report.sxw)
- export sxw to rml
- replace rml file to file system (example/report/report.rml)
PS : Some of report can't reload layout automatically we need to unchecked in Technical Feature
Check the “Reload from attachment” checkbox for the invoice report.
Navigate to:
Settings -> Customization -> Low Level Objects -> Actions -> Reports
(Version 6.1)Settings -> Technical -> Actions -> Reports
(Version 7.0)Find and open the record for the Invoice – it will be called Invoices and have a service name of account.invoice.
If the “Reload from attachment” checkbox is checked, running the report will keep returning the first version of the report from the saved attachment.
Uncheck the checkbox and the invoice report will be created with the new name and logo.
แท็ก:open-office