OpenERP is one of the largest Open Source ERP solutions. It comes with number of reporting tools like RML, Webkit and Aeroo as an integral part of activity management for any company. OpenERP is flexible to integrate with other reporting engines such as Jasper, BIRT reports.
In most of the official addons, OpenERP uses RML report engine to generate report. But there are plenty of features which lets you be a fan of Webkit report.
- Generates PDF reports from the mako template.
- HTML like template.
- CSS can be use to shine the report.
- Possible to use basic java script.
- Easy to develop and design.
- Faster parsing.
- Paper size definition
- Multi header support
Module report_webkit will be required to make or convert Webkit reports.
Wkhtmltopdf is required to generate mako template in pdf, to get the debian based distribution visit Google wkhtmltopdf project . And download wkhtmltopdf-i386 binary version. Do not download apha version or wkhtmltoimage .
RML Report |
Webkit Report
|
|
|
While converting RML report to Webkit report you need to do few changes which are highlighted in below,
File | RML | Webkit |
__init__.py | import sale_order |
import sale_order
|
__openerp__.py |
{
'name': 'Demo Report', 'version': '1.0', 'category': 'Demo Module ', 'sequence': 1, 'summary': 'Demo Report', 'description': """ Module Description """, 'author': 'Serpent Consulting Services', 'website': 'www.serpentcs.com', 'depends': ['base'], 'data': [ 'report.xml', ], 'installable': True, 'application': True, 'auto_install': False, } |
{
'name': 'Demo Report', 'version': '1.0', 'category': 'Demo Module ', 'sequence': 1, 'summary': 'Demo Report', 'description': """ Module Description """, 'author': 'Serpent Consulting Services', 'website': 'www.serpentcs.com', 'depends': ['base', 'report_webkit'], 'data': [ 'report.xml', ], 'installable': True, 'application': True, 'auto_install': False, } |
report.py |
import time from openerp.report import report_sxw class order(report_sxw.rml_parse): def __init__ (self, cr, uid, name,context=None): super(order, self). __init__ (cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) report_sxw.report_sxw ('report.sale.order', 'sale.order', 'addons /sale/report/ sale_order.rml', parser=order, header="external") |
import time from openerp.report import report_sxw class order(report_sxw.rml_parse): def __init__ (self, cr, uid, name,context=None): super(order, self). __init__ (cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) report_sxw.report_sxw ('report.sale.order', 'sale.order', 'addons/sale/report/ sale_order_webkit.mako', parser=order, header="external") |
report.xml |
<report auto="False" id="report_sale_order" model="sale.order" name="sale.order" rml="sale/report/sale_order.rml" string="Quotation / Order" /> |
<report auto="False" id="report_sale_order" model="sale.order" name="sale.webkit.order" file="webkit_sale/report/ sale_order_webkit.mako" string="Quotation / Order webkit" report_type="webkit" /> |
Mako template Syntax is simpler and some extra featured then RML, like conditional statements & python code block. Mako template is having batter management for loops and expressions.
RML syntax Mako syntax
RML syntax | Mako syntax | |
Expression | [[]]
eg. [[o.name or '']]
|
${}
eg. ${o.name or ''}
|
Loop |
[[repeatIn()]]
eg. [[ repeatIn(o.order_line,'line') ]]
|
%for i in []:
%endfor
eg. %for line in o.order_line:
%endfor
|
Condition | None | %if condition:
%endif
eg. %if i==1: %endif
|
Table | <blockTable>
</blockTable>
|
<table>
</table>
|
Paragraph
|
<para>
eg. <para style="terp_default_8">
|
<p></p>
eg. <p style="page-break-after:always"></p>
|
Python code | None | <%
python code
%>
|
Comments | <!– comments –> | ## its a single line comment
<%doc>
This
is multi line
comments
<%/doc>
|
Additional Steps:
Technical Features are enabled or not.After converting it’s time to install / update the module, but before that we need to add a system parameter in OpenERP. To add System parameter go through Settings > Technical > Parameters > System Parameters, if you don’t see this menu kindly check the user configuration, if Technical Features are enabled or not. Here you need to create new system parameter, in that give key as a ‘webkit_path’ and value of wkhtmltopdf (webkit executable) which you need to download from Google Wkhtmltopdf Project.
from: http://www.serpentcs.com/serpentcs-rml-to-webkit-report-guide
相关推荐
reportlab 用到的rml2pdf工具包。
limited to database reports, are typically Windows-based, have problematic restrictions on layout and graphic design, and go straight to a printer. More complex publishing systems involve pipelines of...
Efficient SPARQL-to-SQL with R2RML Mappings
D2RQ_to_R2RML 将 D2RQ 映射文档转换为 R2RML 映射文档的 Python 脚本 用法 您可以通过执行以下命令来运行转换: python D2RQ_to_R2RML.py -i <inputFile> -o 和 <inputFile> = The D2RQL mapping document ...
《RML Lab 音频工作站》(SawStudio v4.9)V4.9汉化版
RML2016a数据集生成代码
将数据库信息发布为关联数据,数据格式必须为RDF格式,则R2RML是一种被广泛使用的映射语言。
RML Help 帮助文档 英文版 免费贡献给大家
调制信号识别数据集RML2016.10A
RML&2002邮件列表2.02版
reportlab生成PDF工具类trml2pdf工具类的文档,英文版。
RML_rml_极大似然法_极大似然估计_参数估计.zip
本案例针对RML2016.10a_dict数据集并利用VT-CNN2 Mod-Rec Network卷积神经网络对信号实现自动调制方式识别,使用卷积神经网络在图像处理问题中的位移不变性特点,来解决调制识别的问题,使用网络结构来学习匹配...
很少能看到关于RML的东西,这个可是绝版哦
瑞利信道数据集
rml系统辨识源代码.个人珍藏.在matlab环境下应用.
RML for Sql Server性能分析工具的使用.pdf
RMLSetup 是一款SQL Server效率优化分析工具,可配合SQL Server Profiler 一起使用,是SQL Server DBA 或者想深入学习SQL Server 的必备工具,资源包括X86和X64版本。
RML极大拟然参数估计方法辨识程序 可以很好实现 好的很