You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Foo Shyn Chung <ip...@gmail.com> on 2012/03/28 10:50:54 UTC

fo ftl pagination

Hi all,

Sorry if this sounds noob as this is the first time i'm generating a report
via the fo.ftl route.

I'd managed to create the report and generated it to a pdf file, however i
notice that, when the page break, it actually breaks between the data
within a row, rather than breaking gracefully (as in, the next page will
starts will a new record).

Example:

The record is something like:

1.  Name: A
     IC: 39043480984
     Phone No: 02-343434


at the end of the page, the row would be dissected into 2 parts, with the
2nd part at the next page:

1. Name: J
    IC: 0983403804834


(start of next page)
    Phone No: 03-34340938


Any method that i can do to make sure that the page will break at the
correct place?

Thanx
FooShyn

Re: fo ftl pagination

Posted by Foo Shyn Chung <ip...@gmail.com>.
Thanx for the pointer to the keep-together property, managed to solve it
using keep-together.within-page="always"

Thanx a lot!
FooShyn

On Wed, Mar 28, 2012 at 6:00 PM, Jacopo Cappellato <
jacopo.cappellato@hotwaxmedia.com> wrote:

> You can use a <block> element to wrap the record and use the keep-together
> attribute like this:
>
> <fo:block keep-together="always">
> Name
> IC
> Phone
> </fo:block>
>
>
> On Mar 28, 2012, at 10:50 AM, Foo Shyn Chung wrote:
>
> > Hi all,
> >
> > Sorry if this sounds noob as this is the first time i'm generating a
> report
> > via the fo.ftl route.
> >
> > I'd managed to create the report and generated it to a pdf file, however
> i
> > notice that, when the page break, it actually breaks between the data
> > within a row, rather than breaking gracefully (as in, the next page will
> > starts will a new record).
> >
> > Example:
> >
> > The record is something like:
> >
> > 1.  Name: A
> >     IC: 39043480984
> >     Phone No: 02-343434
> >
> >
> > at the end of the page, the row would be dissected into 2 parts, with the
> > 2nd part at the next page:
> >
> > 1. Name: J
> >    IC: 0983403804834
> >
> >
> > (start of next page)
> >    Phone No: 03-34340938
> >
> >
> > Any method that i can do to make sure that the page will break at the
> > correct place?
> >
> > Thanx
> > FooShyn
>
>

Re: fo ftl pagination

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
You can use a <block> element to wrap the record and use the keep-together attribute like this:

<fo:block keep-together="always">
Name
IC
Phone
</fo:block>


On Mar 28, 2012, at 10:50 AM, Foo Shyn Chung wrote:

> Hi all,
> 
> Sorry if this sounds noob as this is the first time i'm generating a report
> via the fo.ftl route.
> 
> I'd managed to create the report and generated it to a pdf file, however i
> notice that, when the page break, it actually breaks between the data
> within a row, rather than breaking gracefully (as in, the next page will
> starts will a new record).
> 
> Example:
> 
> The record is something like:
> 
> 1.  Name: A
>     IC: 39043480984
>     Phone No: 02-343434
> 
> 
> at the end of the page, the row would be dissected into 2 parts, with the
> 2nd part at the next page:
> 
> 1. Name: J
>    IC: 0983403804834
> 
> 
> (start of next page)
>    Phone No: 03-34340938
> 
> 
> Any method that i can do to make sure that the page will break at the
> correct place?
> 
> Thanx
> FooShyn


Re: fo ftl pagination

Posted by Pierre Smits <pi...@gmail.com>.
Hi FooShyn,

For a solutions for a secondment agency I created an application that
generates profiles of the employees who are assigned to secondment projects.

For every assignment a new experience page needed to be generated.

The way I solved this was:
iterate thru the records retrieved in the fo.ftl with:

<#list experienceItems as experienceItem>

Subsequently build the page with the details to be displayed, starting with:

<fo:page-sequence
master-reference="${pageLayoutName?default("experience-page")}">

>From then include the specifics

Each page ends with:

</fo:page-sequence>

End the iteration with:

</#list>


The above should be helpful to get your problem solved.

Regards,

Pierre Smits

Op 28 maart 2012 10:50 schreef Foo Shyn Chung <ip...@gmail.com> het
volgende:

> Hi all,
>
> Sorry if this sounds noob as this is the first time i'm generating a report
> via the fo.ftl route.
>
> I'd managed to create the report and generated it to a pdf file, however i
> notice that, when the page break, it actually breaks between the data
> within a row, rather than breaking gracefully (as in, the next page will
> starts will a new record).
>
> Example:
>
> The record is something like:
>
> 1.  Name: A
>     IC: 39043480984
>     Phone No: 02-343434
>
>
> at the end of the page, the row would be dissected into 2 parts, with the
> 2nd part at the next page:
>
> 1. Name: J
>    IC: 0983403804834
>
>
> (start of next page)
>    Phone No: 03-34340938
>
>
> Any method that i can do to make sure that the page will break at the
> correct place?
>
> Thanx
> FooShyn
>