fo ftl pagination

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

fo ftl pagination

Foo Shyn Chung
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
Reply | Threaded
Open this post in threaded view
|

Re: fo ftl pagination

Pierre Smits
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 <[hidden email]> 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
>
Reply | Threaded
Open this post in threaded view
|

Re: fo ftl pagination

Jacopo Cappellato-4
In reply to this post by Foo Shyn Chung
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

Reply | Threaded
Open this post in threaded view
|

Re: fo ftl pagination

Foo Shyn Chung
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 <
[hidden email]> 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
>
>