PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: How Split a Table Header In Each Page
   PostPosted: 24 Sep 2010, 13:42 
Hi All,

I Have One Small Problem i.e we have One Table The Table Header Are Print In Each Page

How To I Write A code Please Tell Me!


Note:- I am Writing The Code In html.

I Hope U have Solve This Small Problem


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 23 Oct 2010, 14:43 
PD4ML API includes enableSmartTableBreaks() (formerly enableTableBreaks()) method. The method forces PD4ML to split tables protecting table rows content and to replicate table headers (if any) from page to page. Unfortunately there is no way to trigger the mode from HTML code yet.

Table header ia a row (or multiple rows) consists of <th> tags only.

In v361b2 the table break logic was significantly refactored. So it is recommended to use the build or a newer one.


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 28 Apr 2011, 04:21 
I have the following CSS and table html

tr.noBreakCell{
page-break-inside:avoid;
}

<table>
<tr>
<th>header 1</th>
<th>header 2</th>
<th>header 3</th>
<th>header 4</th>
</tr>
<tr class='noBreakCell'>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
<td>cell 4</td>
</tr>
<tr class='noBreakCell'>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
<td>cell 4</td>
</tr>
...
<tr class='noBreakCell'>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
<td>cell 4</td>
</tr>
</table>

I have a number of tr row with class = noBreakCell, I found that when I not use:
pd4mlObj.enableSmartTableSplit(true);

the table is break while row does not break inside, this is fine.

But I try to have the table header repeat on different page, it turns out that the whole table is being moved to the next page instead of splitting into multiple page, did I use anything wrongly?


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 28 Apr 2011, 04:30 
Previous post typo mistable, it should be
enableSmartTableBreaks(true);


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 28 Apr 2011, 06:42 
Here this is the HTML that I try to print using PD4ML:
download fromdropbox:
http://dl.dropbox.com/u/9697160/PackNote.htm
I applied page-break-inside:avoid in tr with class 'noBreak'

When I set enableSmartTableBreaks(false); or not apply the statement, it can split table without spliting table tr row, just the table header does not repeat.

When I set enableSmartTableBreaks(true); as the table cannot fit completely in the first page, it completely moved to the second page. leaving the first page with blank area.

PD4ML is great in helpping us developing our print out function but just this spliting not yet fulfill our print test. Really look forward to see whether it is because of my table html / css or JAVA set wrongly.

The ver of PD4ML we used: 3701b1 demo (we need to see PD4ML fulfill our test in order to buy the volumn licenses)
code for html generation: JAVA/JSP
how we use pd4ml: we build jsp report and use PD4ML to handle the print by mean of converting the built pdf file to bytearray and send to our printer.


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 29 Apr 2011, 12:51 
enableSmartTableBreaks(true) implicitly defines

TABLE, TR { page-break-inside: avoid }

You may partially override it with

TABLE { page-break-inside: auto !important }

to prevent a table moving to its next page.


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 03 May 2011, 05:32 
Does this valid in PD4ML if I wish a particular block not to be broken:

div{page-break-inside: avoid}


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 03 May 2011, 13:06 
For DIV it should work.


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 23 May 2011, 07:34 
ustarhk wrote:
I have the following CSS and table html

tr.noBreakCell{
page-break-inside:avoid;
}

<table>
<tr>
<th>header 1</th>
<th>header 2</th>
<th>header 3</th>
<th>header 4</th>
</tr>
<tr class='noBreakCell'>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
<td>cell 4</td>
</tr>
<tr class='noBreakCell'>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
<td>cell 4</td>
</tr>
...
<tr class='noBreakCell'>
<td>cell 1</td>
<td>cell 2</td>
<td>cell 3</td>
<td>cell 4</td>
</tr>
</table>

I have a number of tr row with class = noBreakCell, I found that when I not use:
pd4mlObj.enableSmartTableSplit(true);

the table is break while row does not break inside, this is fine.

But I try to have the table header repeat on different page, it turns out that the whole table is being moved to the next page instead of splitting into multiple page, did I use anything wrongly?


  Subject: Re: How Split a Table Header In Each Page
   PostPosted: 23 May 2011, 16:44 
pd4mlObj.enableSmartTableSplit(true) API call implicitly defines

TABLE, TR {page-break-inside: avoid }

In order to workaround the issue you faced with, I would recommend to partially unset the CSS style with

TABLE {page-break-inside: avoid !important}



[Reply]     [ 10 posts ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share