You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Sushanth <su...@gmail.com> on 2010/07/07 11:31:12 UTC
Keeping fo:table-header and fo:table-body together within a page
First of all, I'm extremely sorry for the long text that follows this :)
I looked all around the internet for a solution to this problem and still
haven't found a straightforward solution. I am generating a PDF using FOP
0.95, where I have a bunch of pages, each of which can have multiple tables.
There are times I encounter this problem where the fo:table-header content
of one of the tables ends up as the last element on a page with no
table-body under it. The table-body starts on the next page, of course
preceded by table-header on the next page also which is fine, but is there
any way I can prevent a table-header from ending up as the last element on a
page if there is not enough space for the table-body to be displayed on the
same page?
The options I have tried so far include using
keep-together.within-page="always". This doesn't help because some tables
can even span multiple pages, in which case a page-break is not introduced.
I have read that FOP-Trunk provides integer support for keep-together, but I
wasn't able to build the FOP-Trunk jar. Is there any place where I can
directly download the latest FOP-Trunk jar?
The other option I have tried is brute-force, trying to keep count of the
number of rows printed on a page and introducing a manual page break, but
this is an ugly patch and I want to avoid using it and it will not work in
all scenarios.
Is there a simple solution to this problem using FOP 0.95? I'm sure somebody
would have anticipated this problem while developing FOP and must have some
solution in place for this :) Please let me know. I can't live with this
problem anymore.
--
View this message in context: http://old.nabble.com/Keeping-fo%3Atable-header-and-fo%3Atable-body-together-within-a-page-tp29094189p29094189.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: AW: Keeping fo:table-header and fo:table-body together within
a page
Posted by Pascal Sancho <pa...@takoma.fr>.
Sushanth,
without a clean XSL-FO snippet, we only can provide you 'hypothetic'
solutions.
a possible solution should be using the 2 Fop extensions
fox:orphan-content-limit and fox:widow-content-limit.
Read [1] for further details.
[1]
http://xmlgraphics.apache.org/fop/0.95/extensions.html#widow-orphan-content-limit
--
Pascal
Le 07/07/2010 11:58, Georg Datterl a écrit :
> Hi Sushanth.
>
> First question: Are you definitely sure there are no body lines on the first page? You don't have empty lines (for spacing or because of missing data) at the beginning of your table? If so, please drop us a code example, because then I guess it would be a bug.
>
> If you have empty lines, put a keep-with-next.within-page="always" on them.
>
> Regards,
>
> Georg Datterl
>
> -----Ursprüngliche Nachricht-----
> Von: Sushanth [mailto:sushanth.rao@gmail.com]
>
> First of all, I'm extremely sorry for the long text that follows this :)
>
> I looked all around the internet for a solution to this problem and still
> haven't found a straightforward solution. I am generating a PDF using FOP
> 0.95, where I have a bunch of pages, each of which can have multiple tables.
> There are times I encounter this problem where the fo:table-header content
> of one of the tables ends up as the last element on a page with no
> table-body under it. The table-body starts on the next page, of course
> preceded by table-header on the next page also which is fine, but is there
> any way I can prevent a table-header from ending up as the last element on a
> page if there is not enough space for the table-body to be displayed on the
> same page?
>
> The options I have tried so far include using
> keep-together.within-page="always". This doesn't help because some tables
> can even span multiple pages, in which case a page-break is not introduced.
> I have read that FOP-Trunk provides integer support for keep-together, but I
> wasn't able to build the FOP-Trunk jar. Is there any place where I can
> directly download the latest FOP-Trunk jar?
>
> The other option I have tried is brute-force, trying to keep count of the
> number of rows printed on a page and introducing a manual page break, but
> this is an ugly patch and I want to avoid using it and it will not work in
> all scenarios.
>
> Is there a simple solution to this problem using FOP 0.95? I'm sure somebody
> would have anticipated this problem while developing FOP and must have some
> solution in place for this :) Please let me know. I can't live with this
> problem anymore.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: AW: Keeping fo:table-header and fo:table-body together within a
page
Posted by Sushanth <su...@gmail.com>.
Thanks Georg,
Looks like I was making a mountain out of a molehill, it was indeed the
presence of a blank row at the beginning of my table-body that was causing
this problem. I had put a keep-with-next.within-page="always" on the last
row in the header and also put keep-with-previous.within-page="always" on
the first row (blank row) of my table body, but there was no connection
between the first row of my table body and the rest of the rows, hence only
the first blank row of the table body was appearing along with the
table-hader at the end of the page.
Sorry if I wasted anybody's time, I'm still only a novice. Thanks again :)
Georg Datterl wrote:
>
> Hi Sushanth.
>
> First question: Are you definitely sure there are no body lines on the
> first page? You don't have empty lines (for spacing or because of missing
> data) at the beginning of your table? If so, please drop us a code
> example, because then I guess it would be a bug.
>
> If you have empty lines, put a keep-with-next.within-page="always" on
> them.
>
> Regards,
>
> Georg Datterl
>
> ------ Kontakt ------
>
> Georg Datterl
>
> Geneon media solutions gmbh
> Gutenstetter Straße 8a
> 90449 Nürnberg
>
> HRB Nürnberg: 17193
> Geschäftsführer: Yong-Harry Steiert
>
> Tel.: 0911/36 78 88 - 26
> Fax: 0911/36 78 88 - 20
>
> www.geneon.de
>
> Weitere Mitglieder der Willmy MediaGroup:
>
> IRS Integrated Realization Services GmbH: www.irs-nbg.de
> Willmy PrintMedia GmbH: www.willmy.de
> Willmy Consult & Content GmbH: www.willmycc.de
>
>
> -----Ursprüngliche Nachricht-----
> Von: Sushanth [mailto:sushanth.rao@gmail.com]
> Gesendet: Mittwoch, 7. Juli 2010 11:31
> An: fop-users@xmlgraphics.apache.org
> Betreff: Keeping fo:table-header and fo:table-body together within a page
>
>
> First of all, I'm extremely sorry for the long text that follows this :)
>
> I looked all around the internet for a solution to this problem and still
> haven't found a straightforward solution. I am generating a PDF using FOP
> 0.95, where I have a bunch of pages, each of which can have multiple
> tables.
> There are times I encounter this problem where the fo:table-header content
> of one of the tables ends up as the last element on a page with no
> table-body under it. The table-body starts on the next page, of course
> preceded by table-header on the next page also which is fine, but is there
> any way I can prevent a table-header from ending up as the last element on
> a
> page if there is not enough space for the table-body to be displayed on
> the
> same page?
>
> The options I have tried so far include using
> keep-together.within-page="always". This doesn't help because some tables
> can even span multiple pages, in which case a page-break is not
> introduced.
> I have read that FOP-Trunk provides integer support for keep-together, but
> I
> wasn't able to build the FOP-Trunk jar. Is there any place where I can
> directly download the latest FOP-Trunk jar?
>
> The other option I have tried is brute-force, trying to keep count of the
> number of rows printed on a page and introducing a manual page break, but
> this is an ugly patch and I want to avoid using it and it will not work in
> all scenarios.
>
> Is there a simple solution to this problem using FOP 0.95? I'm sure
> somebody
> would have anticipated this problem while developing FOP and must have
> some
> solution in place for this :) Please let me know. I can't live with this
> problem anymore.
>
> --
> View this message in context:
> http://old.nabble.com/Keeping-fo%3Atable-header-and-fo%3Atable-body-together-within-a-page-tp29094189p29094189.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/Keeping-fo%3Atable-header-and-fo%3Atable-body-together-within-a-page-tp29094189p29096754.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
AW: Keeping fo:table-header and fo:table-body together within a page
Posted by Georg Datterl <ge...@geneon.de>.
Hi Sushanth.
First question: Are you definitely sure there are no body lines on the first page? You don't have empty lines (for spacing or because of missing data) at the beginning of your table? If so, please drop us a code example, because then I guess it would be a bug.
If you have empty lines, put a keep-with-next.within-page="always" on them.
Regards,
Georg Datterl
------ Kontakt ------
Georg Datterl
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert
Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
www.geneon.de
Weitere Mitglieder der Willmy MediaGroup:
IRS Integrated Realization Services GmbH: www.irs-nbg.de
Willmy PrintMedia GmbH: www.willmy.de
Willmy Consult & Content GmbH: www.willmycc.de
-----Ursprüngliche Nachricht-----
Von: Sushanth [mailto:sushanth.rao@gmail.com]
Gesendet: Mittwoch, 7. Juli 2010 11:31
An: fop-users@xmlgraphics.apache.org
Betreff: Keeping fo:table-header and fo:table-body together within a page
First of all, I'm extremely sorry for the long text that follows this :)
I looked all around the internet for a solution to this problem and still
haven't found a straightforward solution. I am generating a PDF using FOP
0.95, where I have a bunch of pages, each of which can have multiple tables.
There are times I encounter this problem where the fo:table-header content
of one of the tables ends up as the last element on a page with no
table-body under it. The table-body starts on the next page, of course
preceded by table-header on the next page also which is fine, but is there
any way I can prevent a table-header from ending up as the last element on a
page if there is not enough space for the table-body to be displayed on the
same page?
The options I have tried so far include using
keep-together.within-page="always". This doesn't help because some tables
can even span multiple pages, in which case a page-break is not introduced.
I have read that FOP-Trunk provides integer support for keep-together, but I
wasn't able to build the FOP-Trunk jar. Is there any place where I can
directly download the latest FOP-Trunk jar?
The other option I have tried is brute-force, trying to keep count of the
number of rows printed on a page and introducing a manual page break, but
this is an ugly patch and I want to avoid using it and it will not work in
all scenarios.
Is there a simple solution to this problem using FOP 0.95? I'm sure somebody
would have anticipated this problem while developing FOP and must have some
solution in place for this :) Please let me know. I can't live with this
problem anymore.
--
View this message in context: http://old.nabble.com/Keeping-fo%3Atable-header-and-fo%3Atable-body-together-within-a-page-tp29094189p29094189.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org