แสดงบทความที่มีป้ายกำกับ Open ERP แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Open ERP แสดงบทความทั้งหมด

OpenOffice.org reports

OpenOffice.org reports

The document flow
OpenOffice.org reports are the most commonly used report formats. OpenOffice.org Writer is used (in combination with [[1]]) to generate a RML template, which in turn is used to generate a pdf printable report.
../../_images/ooo_report_overview.png
The internal process
../../_images/process_ooo.png
The .SXW template file
  • We use a .SXW file for the template, which is the OpenOffice 1.0 format. The template includes expressions in brackets or OpenOffice fields to point where the data from the OpenERP server will be filled in. This document is only used for developers, as a help-tool to easily generate the .RML file. OpenERP does not need this .SXW file to print reports.
The .RML template
  • We generate a .RML file from the .SXW file using Open SXW2RML. A .RML file is a XML format that represent a .PDF document. It can be converted to a .PDF after. We use RML for more easy processing: XML syntax seems to be more common than PDF syntax.
The report engine
  • The Open Report Engine process the .RML file inserting data from the database at each expression.
in the .RML file will be replaced by the name of the country of the partner of the printed invoice. This report engine produce the same .RML file where all expressions have been replaced by real data.
The final document
  • Finally the .RML file is converted to PDF or HTML as needed, using OpenReport’s scripts.
http://doc.openerp.com/v6.0/_images/writer_report.png
อ้างอิง : Open ERP

Open ERP report วิธีการแปล openoffice เป็น rml เพื่อใช้ในการออกรายงาน


วิธีการแปล openoffice เป็น rml เพื่อใช้ในการออกรายงาน

การทำ Report ของ OpenERP มีวิธีการอยู่หลายรูปแบบ
แต่หลักๆแล้วจะมีอยู่ 3 วิธี
1. OpenOffice report
2. Rml Report
3. Custom Report

สำหรับตอนนี้จะอธิบายวิธีการทำ report จาก file openoffice
ที่จริงแล้ว OpenERP มี Report Designer ซึ่งเป็น Addons ของ openoffice
แต่ว่า Openoffice Report Designer ปัจจุบันยังไม่เปิดให้ใช้ Free เพราะ เป็น Shared Fundings Projects
ซึ่งความหมายคือ ใช้งบประมาณในการพัฒนาโปรเจคนี้ขึ้นมา และต้องการที่จะคืนทุนก่อน ที่จะออกเป็น opensource ให้ใช้ฟรี

อย่างไรก็แล้วแต่ ถึงไม่มี openoffice report designer ก็สามารถสร้าง report ได้ โดยไม่ต้องใช้ addons นั้น
เพียงเราใช้ openoffice design แล้วใช้ script ที่อยู่ใน module base_report_designer
วิธีการ มีดังนี้ (Ubuntu)
1. เข้าไปที่ไฟล์ script
 cd OPENERP_ADDONS_PATH/base_report_designer/wizard

2. ทำการแก้ไขรายงาน จากที่มีอยู่ในโมดูลต่างๆ ที่สนใจ(เพื่อดูให้เห็นเป็นตัวอย่าง)
3. หลังจากมีการแก้ไขเสร็จแล้ว ให้ save เป็นนามสกุล sxw หรือ odt ก็ได้
4. นำไฟล์ที่ save นั้นไปวางไว้ที่ base_report_desinger/wizard
5. ทำการ run script เพื่อแปลง file openoffice เป็น rml
 $ python tiny_sxw2rml.py filename.sxw > some-name-you-need.rml

6. หลังจากนั้น นำไฟล์ rml ที่ได้ไปวางไว้ที่ module ที่เอามา

ยกตัวอย่างการแปล
ต้องการแก้ Sale Order form ใน Sale module
addons/sale/order.sxw
เลือกไฟล์ order.sxw มา เพื่อจะแปลงกลับไปเป็น order.rml ตัวใหม่ที่มีการแก้ไข

 $python tiny_sxw2rml.py order.sxw > order.rml

จากนั้นก็เอาไปวางทับที่เดิม ในโมดูล sale
addons/sale/report/order.rml

อ้างอิง : Thailand Open ERP Community