Odoo報表的report標簽和報表格式定義


轉載請注明原文地址:https://www.cnblogs.com/ygj0930/p/10826329.html

 

一:Report標簽

    report標簽可用於定義一條報表記錄。屬性有:

        1)id

        生成的數據的id。

        2)name (必選)

        報表名,用於查找及描述。

        3)model (必選)

        報表記錄所對應的模型。

        4)report_type (必選) 

        qweb-pdf| qweb-html

        5)report_name

        輸出pdf時文件名。

        6)groups

        用於指定可以查看、使用該報表的用戶組。

        7)attachment_use

        如果設置為true時,該報表會以記錄的附件的形式保存,一般用於一次生成、多次使用的報表。

        8)attachment

        用於定義報表名的python表達式,使記錄可以通過object對象訪問。

        9)paperformat 

        用於打印報表的文件格式的外部id(默認是公司的格式)(可以自定義格式)。

        例子:

<report
    id="account_invoices"
    model="account.invoice"
    string="Invoices"
    report_type="qweb-pdf"
    name="account.report_invoice"
    file="account.report_invoice"
    attachment_use="True"
    attachment="(object.state in ('open','paid')) and
        ('INV'+(object.number or '').replace('/','')+'.pdf')" //拼接文件名
/>

 

二:報表格式

        報表格式用report.paperformat記錄來定義,字段有:

        1)name (必選)

        用於查找及區分的名字。

        2)description

        格式的描述。

        3)format

        一個預定義的紙張大小格式如(A0-A9,B0-B10等)或自定義custom,默認是A4。

        4)dpi

        輸出的DPI,默認90。

        5)margin_top, margin_bottom, margin_left, margin_right

        以 mm 為單位的margin值。

        6)page_height, page_width

        以  mm  為單位的頁面寬高尺寸值。

       7)orientation

        紙張橫向或縱向打印。

        8)Landscape , Portrait header_line 

        boolean類型,是否顯示標題行。

        9)header_spacing

        以 mm  為單位的頭部空白尺寸。

 

     例子:

<record id="paperformat_frenchcheck" model="report.paperformat">
    <field name="name">French Bank Check</field>
    <field name="default" eval="True"/>
    <field name="format">custom</field>
    <field name="page_height">80</field>
    <field name="page_width">175</field>
    <field name="orientation">Portrait</field>
    <field name="margin_top">3</field>
    <field name="margin_bottom">3</field>
    <field name="margin_left">3</field>
    <field name="margin_right">3</field>
    <field name="header_line" eval="False"/>
    <field name="header_spacing">3</field>
    <field name="dpi">80</field>
</record>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 HTML 表格:表格由 RDLC報表格式化format表達式 Pentaho Report Designer 報表系統 - 入門詳解 ALV的報表對用戶定義格式的控制(ALV I_SAVE) 修改水晶報表(Crystal Report 2008)中子報表的寬度 DevExpress_Report 主從報表綁定數據,分頁打印 水晶報表(Crystal Report)通過Visual Studio 2010的WPF實現 SAP應用界面開發:5)Report List報表開發(1) Visual Studio 2012使用水晶報表Crystal Report
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM
標簽來定義 【SSRS】入門篇(五) -- 設置報表格式