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 Miroslav Pukhalsky <mi...@dekasoft.com.ua> on 2005/02/18 08:37:43 UTC

Problem with report tail

Hi, there!

I have problem. I should generate PDF file. This report has 2 parts e.g.
body and tail.
If there is enough space for tail on a page after body, tail should be
on the same page like page footer.
If there is not enough space for tail on a page after body, tail should
be on the next page like page footer.
If body has one and half page, tail should be on the second place like 
page footer.

Should be many these reports in one PDF file

I use FOP version 0.20.5 and XSL transformation for report generation.

Help me, please.

Miroslav

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


Re: Problem with report tail

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi!

Chris Bowditch wrote:
> 
> Miroslav Pukhalsky wrote:
> 
> > Hi, there!
> >
> > I have problem. I should generate PDF file. This report has 2 parts e.g.
> > body and tail.
> > If there is enough space for tail on a page after body, tail should be
> > on the same page like page footer.
> > If there is not enough space for tail on a page after body, tail should
> > be on the next page like page footer.
> > If body has one and half page, tail should be on the second place like
> > page footer.
> 
> It sounds to me like you need to keep the tail together, i.e. so there are no
> page-breaks part way through the tail. In XSL-FO, you can put
> keep-together="always" on a block to achieve what you want. However,
> keep-together is only supported on a table-row in FOP.
> 
> You can place your tail content into a table with 1 row and 1 cell, and put
> keep-together="always" on the table-row. This should have the desired effect.
> 
> <snip/>
> 
> Chris
> 

Thanks, it's working.

Miroslav

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


Re: Problem with report tail

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi there!

For solving my problem I have done next:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                exclude-result-prefixes="fo">
    <xsl:output method="xml" version="1.0" omit-xml-declaration="no"
                indent="yes"/>

    <xsl:template match="/">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <!-- Describing pages-->
            <fo:layout-master-set>
                <fo:simple-page-master master-name="main"
                                    page-width="210mm"
                                    page-height="297mm"
                                    margin-top="15mm"
                                    margin-bottom="10mm"
                                    margin-left="20mm"
                                    margin-right="10mm">
                    <fo:region-body/>
                    <fo:region-after extent="60mm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="main">
                <!-- Page Body -->
                <fo:static-content flow-name="xsl-region-after">
                    <fo:block overflow="false">
                        <fo:retrieve-marker retrieve-class-name="tail"
                                            retrieve-boundary="page"
                                           
retrieve-position="last-ending-within-page"/>
                    </fo:block>
                </fo:static-content>

                <!-- Page Body -->
                <fo:flow flow-name="xsl-region-body">
                    <xsl:apply-templates select="report"/>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

    <xsl:template match="report">
        <!-- Report Body -->
        <fo:block>
		....
            <fo:block color="white">
                <fo:block>1.</fo:block>
                ..... Quantity of blocks I got by experimental way. 
                ..... They should cover the same place as tail on the 
                ..... height.
                <fo:block>N.</fo:block>
            </fo:block>
        </fo:block>

        <!-- Report Tail -->
        <fo:block>
            <fo:marker marker-class-name="tail">
                <fo:table border-collapse="separate" 
                          table-layout="fixed">
                    <fo:table-column column-width="180mm"/>
                    <fo:table-body>
                        <fo:table-row keep-together="always">
                            <fo:table-cell>
                                     ....
                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:marker>
        </fo:block>
    </xsl:template>
</xsl:stylesheet>


It's "looks like OK"...

Miroslav

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


Re: Problem with report tail

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi!

The next construction also do not work properly...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:fo="http://www.w3.org/1999/XSL/Format" 
                exclude-result-prefixes="fo">
    <xsl:output method="xml" version="1.0" omit-xml-declaration="no" 
                indent="yes"/>

    <xsl:template match="/">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <!-- Describing pages-->
            <fo:layout-master-set>
                <fo:simple-page-master master-name="main"
                                    page-width="210mm"
                                    page-height="297mm"
                                    margin-top="15mm"
                                    margin-bottom="10mm"
                                    margin-left="20mm"
                                    margin-right="10mm">
                    <fo:region-body/>
                    <fo:region-after extent="60mm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="main">
                <!-- Page Body -->
                <fo:static-content flow-name="xsl-region-after">
                    <fo:block overflow="false">
                        <fo:retrieve-marker retrieve-class-name="tail"
                               retrieve-boundary="page"
                              
retrieve-position="last-ending-within-page"/>
                    </fo:block>
                </fo:static-content>

                <!-- Page Body -->
                <fo:flow flow-name="xsl-region-body">
                    <xsl:apply-templates select="report"/>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

    <xsl:template match="report">
        <!-- Report Body -->
        <fo:block>
        </fo:block>
        
        <!-- Report Tail -->
        <fo:block>
            <fo:marker marker-class-name="tail">
                <fo:table border-collapse="separate"
table-layout="fixed">
                    <fo:table-column column-width="180mm"/>
                    <fo:table-body>
                        <fo:table-row keep-together="always">
                            <fo:table-cell>

                            </fo:table-cell>
                        </fo:table-row>
                    </fo:table-body>
                </fo:table>
            </fo:marker>
        </fo:block>
    </xsl:template>
</xsl:stylesheet>

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


Re: Problem with report tail

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Chris Bowditch wrote:
> I dont understand what you mean. If you insert footnote at end of body, 
> then footnote should appear on last page that content spills onto.

No it wont. In 0.20.5 page generation stops after the main flow
runs out of content, regardless whether there's pending content
from footnotes. This is a known defect.

J.Pietschmann

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


Re: Problem with report tail

Posted by Chris Bowditch <bo...@hotmail.com>.
Miroslav Pukhalsky wrote:

> Hi!
> 
> Chris Bowditch wrote:
> 
>>If you need to ensure content is always placed at the bottom of the last page,
>>then I suggest you try putting this content into a fo:footnote.
>>
> 
> Sorry, but footnotes not workin properly. If body has more than one
> page, footnote prints on the first page, but footnote inline there is
> after body.

I dont understand what you mean. If you insert footnote at end of body, then 
footnote should appear on last page that content spills onto. Are you sure you 
are putting the footnote at end of your content?

Chris


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


Re: Problem with report tail

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi!

Chris Bowditch wrote:
> 
> If you need to ensure content is always placed at the bottom of the last page,
> then I suggest you try putting this content into a fo:footnote.
> 
Sorry, but footnotes not workin properly. If body has more than one
page, footnote prints on the first page, but footnote inline there is
after body.

Miroslav

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


Re: Problem with report tail

Posted by Chris Bowditch <bo...@hotmail.com>.
David Causse wrote:

> Chris Bowditch wrote:
> 
>> You can place your tail content into a table with 1 row and 1 cell, 
>> and put keep-together="always" on the table-row. This should have the 
>> desired effect.
>>
> Hi,
> but how do you force the tail to be placed at the bottom of the page 2 
> if 2 pages are needed? If I understood what Miroslav asked.

I think you misunderstood what Miroslav wanted. He replied saying the 
keep-together worked for him.

> 
> I'm very interested in the solution because I need the same 
> functionnality but I use fo:block-container with absolute position but I 
> have to manage overlap problems...

If you need to ensure content is always placed at the bottom of the last page, 
then I suggest you try putting this content into a fo:footnote.

Chris


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


Re: Problem with report tail

Posted by David Causse <dc...@cognitis.fr>.
Chris Bowditch wrote:

> Miroslav Pukhalsky wrote:
>
>> Hi, there!
>> [..]
>
>
> It sounds to me like you need to keep the tail together, i.e. so there 
> are no page-breaks part way through the tail. In XSL-FO, you can put 
> keep-together="always" on a block to achieve what you want. However, 
> keep-together is only supported on a table-row in FOP.
>
> You can place your tail content into a table with 1 row and 1 cell, 
> and put keep-together="always" on the table-row. This should have the 
> desired effect.
>
Hi,
but how do you force the tail to be placed at the bottom of the page 2 
if 2 pages are needed? If I understood what Miroslav asked.

I'm very interested in the solution because I need the same 
functionnality but I use fo:block-container with absolute position but I 
have to manage overlap problems...

Thank you.


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


Re: Problem with report tail

Posted by Chris Bowditch <bo...@hotmail.com>.
Miroslav Pukhalsky wrote:

> Hi, there!
> 
> I have problem. I should generate PDF file. This report has 2 parts e.g.
> body and tail.
> If there is enough space for tail on a page after body, tail should be
> on the same page like page footer.
> If there is not enough space for tail on a page after body, tail should
> be on the next page like page footer.
> If body has one and half page, tail should be on the second place like 
> page footer.

It sounds to me like you need to keep the tail together, i.e. so there are no 
page-breaks part way through the tail. In XSL-FO, you can put 
keep-together="always" on a block to achieve what you want. However, 
keep-together is only supported on a table-row in FOP.

You can place your tail content into a table with 1 row and 1 cell, and put 
keep-together="always" on the table-row. This should have the desired effect.

<snip/>

Chris


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


Re: Problem with report tail

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi 

For example, I have something like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:fo="http://www.w3.org/1999/XSL/Format" 
                exclude-result-prefixes="fo">
    <xsl:output method="xml" version="1.0" omit-xml-declaration="no" 
                indent="yes"/>

    <xsl:template match="/">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <!-- Describing pages-->
            <fo:layout-master-set>
                <fo:simple-page-master master-name="main"
                                    page-width="210mm"
                                    page-height="297mm"
                                    margin-top="15mm"
                                    margin-bottom="10mm"
                                    margin-left="20mm"
                                    margin-right="10mm">
                    <fo:region-body/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="main">
                <!-- Page Body -->
                <fo:flow flow-name="xsl-region-body">
                    <xsl:apply-templates select="report"/>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

    <xsl:template match="report">
	<!-- Report Body -->
        <fo:block>
        </fo:block>
        
        <!-- Report Tail -->
        <fo:block>
        </fo:block>
    </xsl:template>
</xsl:stylesheet>

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


Re: Problem with report tail

Posted by Miroslav Pukhalsky <mi...@dekasoft.com.ua>.
Hi.

Thanks, but "tail" is not last page in PDF file. It looks like many 
reports into one report. How can I do this...

I think solution of my problem is checking rest place on the page. Can 
I get it using XSL-FO?

Miroslav

Arun Sinha wrote:
> 
> Hi,
> 
> Alternatively you can say that you are trying to make last page special.
> 
> Have a look on the following link that makes first page special.
> 
> http://xml.apache.org/fop/fo.html#fo-first-page
> 
> You can replace first page with last page.
> Hope that solves your problem of last page/footer.
> 
> Cheers.
> 
> Arun
> 
> >From: Miroslav Pukhalsky <mi...@dekasoft.com.ua>
> >Reply-To: fop-user@xml.apache.org
> >To: fop-user@xml.apache.org
> >Subject: Problem with report tail
> >Date: Fri, 18 Feb 2005 09:37:43 +0200
> >
> >Hi, there!
> >
> >I have problem. I should generate PDF file. This report has 2 parts e.g.
> >body and tail.
> >If there is enough space for tail on a page after body, tail should be
> >on the same page like page footer.
> >If there is not enough space for tail on a page after body, tail should
> >be on the next page like page footer.
> >If body has one and half page, tail should be on the second place like
> >page footer.
> >
> >Should be many these reports in one PDF file
> >
> >I use FOP version 0.20.5 and XSL transformation for report generation.
> >
> >Help me, please.
> >
> >Miroslav
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> >For additional commands, e-mail: fop-user-help@xml.apache.org
> >
> 
> _________________________________________________________________
> Manage information better. Optimise your tasks.
> http://www.microsoft.com/india/office/experience/  Experience MS Office
> System.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org

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


Re: Problem with report tail

Posted by Chris Bowditch <bo...@hotmail.com>.
Arun Sinha wrote:

> 
> Hi,
> 
> Alternatively you can say that you are trying to make last page special.
> 
> Have a look on the following link that makes first page special.
> 
> http://xml.apache.org/fop/fo.html#fo-first-page
> 
> You can replace first page with last page.

page-position="last" is not supported by FOP 0.20.5

> Hope that solves your problem of last page/footer.

Chris


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


RE: Problem with report tail

Posted by Arun Sinha <ar...@hotmail.com>.
Hi,

Alternatively you can say that you are trying to make last page special.

Have a look on the following link that makes first page special.

http://xml.apache.org/fop/fo.html#fo-first-page

You can replace first page with last page.
Hope that solves your problem of last page/footer.

Cheers.

Arun

>From: Miroslav Pukhalsky <mi...@dekasoft.com.ua>
>Reply-To: fop-user@xml.apache.org
>To: fop-user@xml.apache.org
>Subject: Problem with report tail
>Date: Fri, 18 Feb 2005 09:37:43 +0200
>
>Hi, there!
>
>I have problem. I should generate PDF file. This report has 2 parts e.g.
>body and tail.
>If there is enough space for tail on a page after body, tail should be
>on the same page like page footer.
>If there is not enough space for tail on a page after body, tail should
>be on the next page like page footer.
>If body has one and half page, tail should be on the second place like
>page footer.
>
>Should be many these reports in one PDF file
>
>I use FOP version 0.20.5 and XSL transformation for report generation.
>
>Help me, please.
>
>Miroslav
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: fop-user-help@xml.apache.org
>

_________________________________________________________________
Manage information better. Optimise your tasks. 
http://www.microsoft.com/india/office/experience/  Experience MS Office 
System.


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