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 shrutin <sh...@mastek.com> on 2009/10/15 13:21:13 UTC

Page Breaks in Table

Hello All,

I have a list of record and each record needs to be displayed on a different
page. But if i add a break-before="page" or break-after="page" i get a blank
page before or after respectively. 
So how could i achieve this requirement without an extra blank page, also
setting the length of the row or column is also not possible before the data
content may vary.

Thanks,
Shruti
-- 
View this message in context: http://www.nabble.com/Page-Breaks-in-Table-tp25906883p25906883.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: Page Breaks in Table

Posted by "Amick, Eric" <Er...@mail.house.gov>.
Where did you put it? It should look something like this:

<fo:table  *other attributes*>
<xsl:if test="position() != 1">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:if>

The <xsl:attribute> must appear before any child element other than
<xsl:attribute>.
I know the technique is sound because I use it myself.

Eric Amick   Systems Engineer II
Legislative Computer Systems


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: AW: Page Breaks in Table

Posted by shrutin <sh...@mastek.com>.
I dont know why by the 
<xsl:attribute name="break-before">page</xsl:attribute> is not working.

This is the exact code that i added.
<xsl:if test="position() != 1">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:if>


Amick, Eric wrote:
> 
> May I suggest, instead of generating an empty block, that you add the
> break-before attribute to the table element instead?
> 
> <xsl:if test="position() != 1">
> <xsl:attribute name="break-before">page</xsl:attribute>
> </xsl:if>
> 
> Put that right under the table start tag.
> 
> 
> Eric Amick   Systems Engineer II
> Legislative Computer Systems
> 
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/Page-Breaks-in-Table-tp25906883p25909738.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: Page Breaks in Table

Posted by "Amick, Eric" <Er...@mail.house.gov>.
May I suggest, instead of generating an empty block, that you add the
break-before attribute to the table element instead?

<xsl:if test="position() != 1">
<xsl:attribute name="break-before">page</xsl:attribute>
</xsl:if>

Put that right under the table start tag.


Eric Amick   Systems Engineer II
Legislative Computer Systems


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: AW: Page Breaks in Table

Posted by shrutin <sh...@mastek.com>.
Hello,
Resolved the issue using this
<xsl:if test="position() != 1">
<fo:block break-before="page">
</fo:block>
</xsl:if>

directly under the 
<xsl:for-each select="record"> tag


Amick, Eric wrote:
> 
>> Hello Georg,
>> 
>> i purposely put break-after attribute because i wanted each and every
>> table
>> on a different page which works good but when it comes to the last
>> record it
>> adds a page break there too :-(.
>> is there a way i could resolve this.
> 
> Use break-before instead; that says to ensure every table starts on a new
> page. (Note that the first table will *not* have a break before it if it
> already starts the page.) Your break-after says to ensure a new page
> begins after every table.
> 
> Eric Amick   Systems Engineer II
> Legislative Computer Systems
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Page-Breaks-in-Table-tp25906883p25908953.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: Page Breaks in Table

Posted by "Amick, Eric" <Er...@mail.house.gov>.
> Hello Georg,
> 
> i purposely put break-after attribute because i wanted each and every
> table
> on a different page which works good but when it comes to the last
> record it
> adds a page break there too :-(.
> is there a way i could resolve this.

Use break-before instead; that says to ensure every table starts on a new page. (Note that the first table will *not* have a break before it if it already starts the page.) Your break-after says to ensure a new page begins after every table.

Eric Amick   Systems Engineer II
Legislative Computer Systems



Re: AW: Page Breaks in Table

Posted by shrutin <sh...@mastek.com>.
Hello Georg,

i purposely put break-after attribute because i wanted each and every table
on a different page which works good but when it comes to the last record it
adds a page break there too :-(.
is there a way i could resolve this.

Georg Datterl wrote:
> 
> Hi shrutin, 
> 
> I guess, since your last table has a break-after="page", there's a page
> break after the last table. And what would a page break be without a
> following page?
> 
> 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: shrutin [mailto:shrutij@mastek.com] 
> Gesendet: Donnerstag, 15. Oktober 2009 14:41
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: Page Breaks in Table
> 
> 
> 
> Hello Sergiu,
> This the peice of xsl that i have made
> 
> <xsl:for-each select="record">
>  <fo:table width="100%" font-size="10pt" break-after="page"> 
> <fo:table-column column-width="3cm" /> <fo:table-column column-width="8cm"
> /> <fo:table-body> <fo:table-row> <fo:table-cell text-align="left">
> <fo:block left="0cm"> <xsl:value-of select="data1"/> </fo:block>
> </fo:table-cell> <fo:table-cell text-align="left"> <fo:block left="0cm">
> <xsl:value-of select="data2"/> </fo:block> </fo:table-cell>
> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2"
> text-align="left" width="100%"> <fo:block left="0cm"> <xsl:value-of
> select="data3"/> </fo:block> </fo:table-cell>
> </fo:table-row>						 
> </fo:table-body>
> </fo:table>
> </xsl:for-each>
> 
> What this does is adds a blank page at the end of the last record.
> 
> I may be doing somthing wrong but am not able to catch it
> 
> 
> Sergiu Dumitriu-2 wrote:
>> 
>> On 10/15/2009 01:21 PM, shrutin wrote:
>>>
>>> Hello All,
>>>
>>> I have a list of record and each record needs to be displayed on a 
>>> different page. But if i add a break-before="page" or 
>>> break-after="page" i get a blank page before or after respectively.
>>> So how could i achieve this requirement without an extra blank page, 
>>> also setting the length of the row or column is also not possible 
>>> before the data content may vary.
>> 
>> Strange, the specification says that only "odd-page" and "even-page" 
>> create blank pages, while "page" simply forces the content to be on a 
>> new page. You either have some other code that generates the extra 
>> page (maybe a previous attempt to insert page breaks, or a break-after 
>> on another element), or there's a bug in FOP. Please check that 
>> there's no problem in your XSLT or FO documents.
>> 
>> --
>> Sergiu Dumitriu
>> http://purl.org/net/sergiu/
>> 
>> ---------------------------------------------------------------------
>> 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://www.nabble.com/Page-Breaks-in-Table-tp25906883p25907859.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://www.nabble.com/Page-Breaks-in-Table-tp25906883p25908067.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: Page Breaks in Table

Posted by Georg Datterl <ge...@geneon.de>.
Hi shrutin, 

I guess, since your last table has a break-after="page", there's a page break after the last table. And what would a page break be without a following page?

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: shrutin [mailto:shrutij@mastek.com] 
Gesendet: Donnerstag, 15. Oktober 2009 14:41
An: fop-users@xmlgraphics.apache.org
Betreff: Re: Page Breaks in Table



Hello Sergiu,
This the peice of xsl that i have made

<xsl:for-each select="record">
 <fo:table width="100%" font-size="10pt" break-after="page">  <fo:table-column column-width="3cm" /> <fo:table-column column-width="8cm" /> <fo:table-body> <fo:table-row> <fo:table-cell text-align="left"> <fo:block left="0cm"> <xsl:value-of select="data1"/> </fo:block> </fo:table-cell> <fo:table-cell text-align="left"> <fo:block left="0cm"> <xsl:value-of select="data2"/> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell number-columns-spanned="2" text-align="left" width="100%"> <fo:block left="0cm"> <xsl:value-of select="data3"/> </fo:block> </fo:table-cell>
</fo:table-row>						 
</fo:table-body>
</fo:table>
</xsl:for-each>

What this does is adds a blank page at the end of the last record.

I may be doing somthing wrong but am not able to catch it


Sergiu Dumitriu-2 wrote:
> 
> On 10/15/2009 01:21 PM, shrutin wrote:
>>
>> Hello All,
>>
>> I have a list of record and each record needs to be displayed on a 
>> different page. But if i add a break-before="page" or 
>> break-after="page" i get a blank page before or after respectively.
>> So how could i achieve this requirement without an extra blank page, 
>> also setting the length of the row or column is also not possible 
>> before the data content may vary.
> 
> Strange, the specification says that only "odd-page" and "even-page" 
> create blank pages, while "page" simply forces the content to be on a 
> new page. You either have some other code that generates the extra 
> page (maybe a previous attempt to insert page breaks, or a break-after 
> on another element), or there's a bug in FOP. Please check that 
> there's no problem in your XSLT or FO documents.
> 
> --
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/Page-Breaks-in-Table-tp25906883p25907859.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


Re: Page Breaks in Table

Posted by shrutin <sh...@mastek.com>.

Hello Sergiu,
This the peice of xsl that i have made

<xsl:for-each select="record">
 <fo:table width="100%" font-size="10pt" break-after="page">
 <fo:table-column column-width="3cm" /> 
<fo:table-column column-width="8cm" /> 
<fo:table-body>
<fo:table-row>
<fo:table-cell text-align="left">
<fo:block left="0cm">
<xsl:value-of select="data1"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left">
<fo:block left="0cm">
<xsl:value-of select="data2"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell number-columns-spanned="2" text-align="left" width="100%">
<fo:block left="0cm">
<xsl:value-of select="data3"/>
</fo:block>
</fo:table-cell>
</fo:table-row>						 
</fo:table-body>
</fo:table>
</xsl:for-each>

What this does is adds a blank page at the end of the last record.

I may be doing somthing wrong but am not able to catch it


Sergiu Dumitriu-2 wrote:
> 
> On 10/15/2009 01:21 PM, shrutin wrote:
>>
>> Hello All,
>>
>> I have a list of record and each record needs to be displayed on a
>> different
>> page. But if i add a break-before="page" or break-after="page" i get a
>> blank
>> page before or after respectively.
>> So how could i achieve this requirement without an extra blank page, also
>> setting the length of the row or column is also not possible before the
>> data
>> content may vary.
> 
> Strange, the specification says that only "odd-page" and "even-page" 
> create blank pages, while "page" simply forces the content to be on a 
> new page. You either have some other code that generates the extra page 
> (maybe a previous attempt to insert page breaks, or a break-after on 
> another element), or there's a bug in FOP. Please check that there's no 
> problem in your XSLT or FO documents.
> 
> -- 
> Sergiu Dumitriu
> http://purl.org/net/sergiu/
> 
> ---------------------------------------------------------------------
> 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://www.nabble.com/Page-Breaks-in-Table-tp25906883p25907859.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: Page Breaks in Table

Posted by Sergiu Dumitriu <se...@xwiki.com>.
On 10/15/2009 01:21 PM, shrutin wrote:
>
> Hello All,
>
> I have a list of record and each record needs to be displayed on a different
> page. But if i add a break-before="page" or break-after="page" i get a blank
> page before or after respectively.
> So how could i achieve this requirement without an extra blank page, also
> setting the length of the row or column is also not possible before the data
> content may vary.

Strange, the specification says that only "odd-page" and "even-page" 
create blank pages, while "page" simply forces the content to be on a 
new page. You either have some other code that generates the extra page 
(maybe a previous attempt to insert page breaks, or a break-after on 
another element), or there's a bug in FOP. Please check that there's no 
problem in your XSLT or FO documents.

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org