KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Exporting: How to insert a page break if table exceeds x number of lines and how to add a row of TH to THEAD? #1085

Open Sergio de Sousa opened this topic on on Sep 13, 2019 - 2 comments

Sergio de Sousa commented on Sep 13, 2019

Hi

So that's my question, in two points:

1) When exporting, my tables break awkwardly because the number of lines exceeds the space on paper size; how can I limit number of lines per page on export to PDF, so that all tables break gracefully when number of rows exceeds a certain number?

2) I need to be able to add a TR (row) to the THEAD on tables, like this (or completely replace the default THEAD from Table):

<thead>
    <tr>
        <th rowspan="2">PCode</th>
        <th rowspan="2">Male</th>
        <th rowspan="2">Female</th>
        <th colspan="5">Ages groups</th>
        <th colspan="6">Income groups</th>
    </tr>
    <tr>
        <th>under 15</th>
        <th>15 to 34</th>
        <th>35 to 44</th>
        <th>45 to 54</th>
        <th>Above 55</th>
        <th>under 15 K</th>
        <th>&gt; 30 and &lt; 50 K</th>
        <th>&gt; 50 and &lt; 70 K</th>
        <th>&gt; 70 and &lt; 100 K</th>
        <th>above 100 K</th>
    </tr>
</thead>

... so the table header actually has two rows, pls see below:

I managed to do this by completely replacing the tables head with javascript, but this simply does not work when exporting. Can you please tell me how to achieve this using KoolReport Table and exporting it? Or any workaround that will work when exporting (my jQuery workaround only works in HTML when displaying on browser) ?

Thank you!

KoolReport commented on Sep 13, 2019

Hi,

For your questions:

  1. Are you using Export package or CloudExport?
  2. You may look for the header grouping, here is the example.
Sergio de Sousa commented on Sep 13, 2019

I am using Export package. I'll check your example, thank you :)

UPDATE: Item 2) is resolved, your example helped. Thank you.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Export