[7.0/trunk]webkit-report repeat table header

Bug #1153426 reported by Joshua Jan(SHINEIT)
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Hi all,

    I found the webkit-report seems does not support repeat header. I try like this
css:
...
.list_tabe thead {
    display:table-header-group;
}
....
report.mako
<table class="list_table" width="100%">
    <thead>
        <td>col1</td>
        <td>col2</td>
    </thead>
%for line in objects:
   <tr>
   <td><td>
   <td></td>
   </tr>
% endfor
</table>
Is there any solution about this? Any help is appreciated.

Joshua

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Joshua,

Hope the following trick will help:

<script>
            function subst() {
                var vars={};
                var x=document.location.search.substring(1).split('&');
                for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
                if(vars['page']!=1){
                   document.getElementById('inner_head').innerHTML=document.getElementById('actual_header').innerHTML;
                }
                var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
                for(var i in x) {
                    var y = document.getElementsByClassName(x[i]);
                    for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
                }
            }

        </script>

    </head>
    <body style="border:0; margin: 0;direction: rtl;" onload="subst()">

        <table id="inner_head" style="width: 100%;margin-left:1%;margin-right:1%;" >

        </table>${_debug or ''|n}
        <table id="actual_header" style="display:none;">

            THE CONTENTS HERE WILL BE REPEATED !

        </table>

Revision history for this message
Joshua Jan(SHINEIT) (joshuajan) wrote :

Hi Serpent,

Thanks your reply. I have try this script. But it seems only work in the report`s header.
page1:
header
----------------------------
%for line in objects:
name:${line.name} ---> This field only for the first page. How I can get the data in the header?
<repeat header>
yyy

Joshua

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → Nicolas Bessi - Camptocamp (nbessi-c2c)
Revision history for this message
Milan Tribuson (milan-infokom) wrote :

Hi, did anyone manage to fix this? I really need repeating header in reports because of big table data...

Revision history for this message
Milan Tribuson (milan-infokom) wrote :

Btw, I'm using OpenERP 6.1 :)

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Milan,

It's a webkit issue which has not been resolved AFAIK, see [1] and [2].

An alternative to wkhtmltopdf could be Prince XML [3] but it's not open source, has a cost, and would require minor changes to report_webkit.

-sbi

[1] https://code.google.com/p/chromium/issues/detail?id=24826
[2] https://code.google.com/p/wkhtmltopdf/issues/detail?id=566
[3] http://www.princexml.com/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.