Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    Qweb打印报表设计 视频分享

    Odoo 新手求助
    3
    7
    6419
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      info521 last edited by

      Qweb打印报表设计
      <br / http://v.youku.com/v_show/id_XMTI4OTU0MDQwOA==.html?from=s1.8-1-1.2 br />
      比较手工做报表简单多了;

      遇到2个问题不会:
      1.报表样式如何应用odoo自带或其它报表使用的样式就是  <!-- Add report style -->
          <xpath expr="//head" position="inside">
              <link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
              <link href="/website/static/src/css/website.css" rel="stylesheet"/>
              <link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
              <style type="text/css">
                  <t t-call="report.style"/>
              </style>
          </xpath>
      如何加到自己开发的报表中去;

      2、如何分页显示,就是套打的如何写代码;每页页数显示;

      3.如何自定义页眉页脚


      1 Reply Last reply Reply Quote 0
      • I
        info521 last edited by

        <xpath expr="//head" position="inside">
                <link href="/web/static/lib/bootstrap/css/bootstrap.css" rel="stylesheet"/>
                <link href="/website/static/src/css/website.css" rel="stylesheet"/>
                <link href="/web/static/lib/fontawesome/css/font-awesome.css" rel="stylesheet"/>
                <style type="text/css">
                    <t t-call="report.style"/>
                </style>
            </xpath>


        直接在 <div class="page">  后面加这个有效果,变成系统自带格式样式

        1 Reply Last reply Reply Quote 0
        • I
          info521 last edited by

          2、如何分页显示,就是套打的如何写代码;每页页数显示;

          页数就是在页脚里面加入代码

          <ul class="list-inline">
                          <li>Page:</li>
                          <li><span class="page"/></li>
                          <li>/</li>
                          <li><span class="topage"/></li>
                      </ul>

          其中页数总页数是由wkhtmltopdf  控制的;

          在打印页面大小格式化的参数都是wkhtmltopdf 的参数体现,odoo仅仅生成htm显示模块;wkhtmltopdf 参数控制了许多显示要素<br / [检测到链接无效,已移除] 通过参数修改可以把报价单生成含有封面和目录的格式

          例如参数:wkhtmltopdf -T 15mm --header-spacing 5 --outline cover http://image.baidu.com --header-html file:///C:/Program%20Files/wkhtmltopdf/bin/a.html --header-line --footer-center "[page]/[topage]" --footer-line toc --toc-header-text "目录" http://www.yaolan.com/zhishi/tinglishaicha/ t2.pdf 就是生成带有封面、目录 页眉页脚的pdf文档;

          3.如何自定义页眉页脚

          在文档page下面加入 页眉页脚代码

          <div class="header">
          页眉内容
          </div>

          <div class="footer">
          页脚内容
          </div>

          其中header、footer是html的代码传递给wkhtmltopdf识别的;

          主体报表(例如订货单)是odoo生成的,页眉、页脚、封面、目录等是由wkhtmltopdf控制的;只要在控制报表page 的代码,就可控制显示了;


          但套打,通过行数控制或页数显示限制,其中html的表格标签控制表头 表体 表低,一直没测试成功;难道一定要写python行数来才做,希望指点。

          1 Reply Last reply Reply Quote 0
          • I
            info521 last edited by

            [attachimg=1]

            纸规格 2折241*140

            页脚代码 高10mm
            <div class="footer">  
            <ul class="list-inline">
                            <li>Page:</li>
                            <li><span class="page"/></li>
                            <li>/</li>
                            <li><span class="topage"/></li>
                              </ul>
                </div>

            页眉类似加入代码即可,样式使用html css bootstrap控制,自己写;


            HTML 表格
            <thead> 标签定义表格的表头。该标签用于组合 HTML 表格的表头内容。
            thead 元素应该与 tbody 和 tfoot 元素结合起来使用。
            tbody 元素用于对 HTML 表格中的主体内容进行分组,而 tfoot 元素用于对 HTML 表格中的表注(页脚)内容进行分组。<br / http://www.w3school.com.cn/tags/tag_thead.asp br />
            thead 写表头达到套打效果,但测试几次不成功,
            在
            <thead>
                                <tr>
                                    <th>Description</th>
                                    <th>Taxes</th>
                                    <th class="text-right">Quantity</th>
                                    <th class="text-right">Unit Price</th>
                                    <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
                                    <th class="text-right">Price</th>
                                </tr>

            插入一行tr 想把公司名称 客户联系联系方式,后期在 tfoot加入签收人等信息,达到套打效果,但测试无效;

            希望懂的指点

            1 Reply Last reply Reply Quote 0
            • Q
              qq342406169 last edited by

              请问你这个示例可以提供源码参考吗?找不到分页的资料

              1 Reply Last reply Reply Quote 0
              • S
                suhuyy last edited by

                谢谢分享

                简单就是美

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post