问题描述
我正在尝试使用报表插件和openoffice创建一个新报表,但是我不知道如何在OpenERP系统中分配它.
I am trying to create a new report with report plugin and openoffice but I don't know how to assign it in the OpenERP system.
有人可以给我确切的步骤来创建新报告并与openerp集成吗?
Is there someone who can give me exact steps for creation of new report and integration with openerp?
提前谢谢!
推荐答案
以下是创建OpenERP RML报告的步骤.
Here are the steps to create the OpenERP RML report.
-
打开open-office.org
open open-office.org
- 工具菜单
- 扩展经理
- 转到-base_report_designer
- 插件→openerp_report_designer.zip
- tools menu
- extension manager
- go to - base_report_designer
- plugin →openerp_report_designer.zip
- 重新启动办公室
- 打开新报告
- 添加循环(选择您的数据库)
- 添加循环作为重复
- 添加字段并使其自定义外观
- 将文件另存为.sxw或发送到服务器
将.sxw转换为.rml
convert .sxw to .rml
-
$> cd to base-report-designer/openerp_sxw2rml
-
$> python openerp_sxw2rml.py ../../exam/report/.sxw > ../../exam/report/.rml
$> cd to base-report-designer/openerp_sxw2rml
$> python openerp_sxw2rml.py ../../exam/report/.sxw > ../../exam/report/.rml
(在报告文件夹中)
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)
(exam.py, exam.rml, exam.sxw, __init__.py)
__ init __.py:
__init__.py:
import exam
-
exam_report.xml
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>
- extension manager
-
__ openerp__.py
在更新中→'exam_report.xml' __openerp__.py
in update → 'exam_report.xml'__ init __.py
__init__.py
import report
这篇关于OpenERP-报表创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
- 扩展经理