Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 3rd, 2013, 04:37 AM
Registered User
 
Join Date: Apr 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Table-Footer & Table Header Problems with markers

Does anyone have a code that can successfully achieve a "table-footer" change (running footer) using markers?

Anytime I use marker and retrieve-table-marker I only get empty values (blank, nothing) in my table footers or table headers.

I have looked many examples but non of them have worked. I'm using Apache FOP 1.0.

Thanks!
 
Old April 4th, 2013, 07:13 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Hi,

If you post a small working example of what you have so far, I'll try and take a look. I use markers in my static regions so perhaps I can see where you may need help.
 
Old April 7th, 2013, 05:40 PM
Registered User
 
Join Date: Apr 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT Markers / Table-Footer

This is the template:


<xsl:template name="ListOfPremiums" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:param name="ParamDivision"/>
<xsl:for-each select="document('c:\dental\xml\LineItem_DDPR_0807 2012060135.xml')/LineItem_Load/Section_Record">
<xsl:variable name="vNumFacturaCompleta" select="StatementIdentifier" />
<xsl:variable name="vPeriodo" select="Period" />
<xsl:variable name="vGrupo" select="GroupNumber" />
<xsl:variable name="vDivision" select="Division" />
<xsl:variable name="vNumFactura" select="substring-before($vNumFacturaCompleta, '-')"/>
<xsl:variable name="vTotalPremiums" select="CurrentPremiums" />
<xsl:variable name="vEnrollees" select="TotalCount" />

<xsl:if test="$vDivision=$ParamDivision and Identifier != 'Adjustments'">
<fo:table>
<fo:table-header>


<!--<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<retrieve-table-marker retrieve-class-name="cont"/>
</fo:block>
</fo:table-cell>
</fo:table-row> -->

<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:retrieve-table-marker retrieve-class-name="section.head.marker"
retrieve-position-within-table="last-ending-within-page"
retrieve-boundary="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>

<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:table>
<fo:table-column column-width="40%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="40%"/>
<fo:table-body>

<!-- <table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<block>
<marker class-name="cont"/>
</block>
</table-cell>
</table-row>
<table-row>
<table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<block>
<marker class-name="cont">Continue</marker>
</block>
</table-cell>
</table-row>-->

<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="12pt" font-family="Tahoma, sans-serif">
List of enrollees and premiums
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="12pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="normal" font-size="10pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vPeriodo"/>
</fo:block>
</fo:table-cell>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:table>
<fo:table-column column-width="40%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="20%"/>
<fo:table-body>
<!-- Primera Fila -->
<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
Invoice number:
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vNumFactura"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
Group:
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vGrupo"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
Division:
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="10pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vDivision"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:table>
<fo:table-column column-width="10%"/>
<fo:table-column column-width="23%"/>
<fo:table-column column-width="17%"/>
<fo:table-column column-width="2%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="8%"/>
<fo:table-body>

<!-- Primera Fila -->
<fo:table-row>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
ENROLLEE ID
</fo:block>
</fo:table-cell>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
ENROLLEE NAME
</fo:block>
</fo:table-cell>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
EFFECTIVE DATE
</fo:block>
</fo:table-cell>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
EMPLOYER
</fo:block>
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
REFERENCE
</fo:block>
</fo:table-cell>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
COVERAGE
</fo:block>
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
OPTION
</fo:block>
</fo:table-cell>
<fo:table-cell border-top-color = "black" border-bottom-color="black" text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
AMOUNT
</fo:block>
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
DUE ($)
</fo:block>
</fo:table-cell>
</fo:table-row>

<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:retrieve-table-marker retrieve-class-name="section.head.marker"
retrieve-position-within-table="last-ending-within-page"
retrieve-boundary="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
</fo:table-header>

<fo:table-footer>
<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:retrieve-table-marker retrieve-class-name="section.head.marker"
retrieve-position-within-table="last-ending-within-page"
retrieve-boundary="table"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-footer>

<fo:table-body>

<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker"></marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker">continued</marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<fo:table>
<fo:table-column column-width="10%"/>
<fo:table-column column-width="23%"/>
<fo:table-column column-width="17%"/>
<fo:table-column column-width="2%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="20%"/>
<fo:table-column column-width="8%"/>
<fo:table-body>
<xsl:for-each select="LineItem_Record">
<xsl:variable name="Nombre" select="FirstName" />
<xsl:variable name="Apellido" select="LastName" />
<xsl:variable name="Tienda" select="StoreLoc" />
<xsl:variable name="FechaEfectividad" select="EffectiveDate" />
<xsl:variable name="NumEnrolleID" select="SUPPID" />
<xsl:variable name="vCoverageOption" select="CoverageOption" />
<xsl:variable name="vAmountDue" select="AmountDue" />

<!--<table-row>
<table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<block>
<marker class-name="cont"/>
</block>
</table-cell>
</table-row>
<table-row>
<table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<block>
<marker class-name="cont"><fo:inline font-weight="bolder">
(Continued)
</fo:inline></marker>
</block>
</table-cell>
</table-row>-->

<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$NumEnrolleID"/>

</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$Apellido"/>, <xsl:value-of select="$Nombre"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$FechaEfectividad"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$Tienda"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<xsl:choose>
<xsl:when test="$vCoverageOption = 01">
EE Only
</xsl:when>
<xsl:when test="$vCoverageOption = 02">
EE + Spouse
</xsl:when>
<xsl:when test="$vCoverageOption = 03">
Family
</xsl:when>
<xsl:when test="$vCoverageOption = 04">
Supercomposite
</xsl:when>
<xsl:when test="$vCoverageOption = 05">
EE + 1 Child
</xsl:when>
<xsl:when test="$vCoverageOption = 06">
EE + Children
</xsl:when>
<xsl:when test="$vCoverageOption = 07">
EE + 1
</xsl:when>
<xsl:when test="$vCoverageOption = 08">
Children Only
</xsl:when>
<xsl:when test="$vCoverageOption = 09">
Spouse Only
</xsl:when>
<xsl:when test="$vCoverageOption = 10">
EE + 2
</xsl:when>
<xsl:when test="$vCoverageOption = 11">
EE + 2 to 4
</xsl:when>
<xsl:when test="$vCoverageOption = 12">
EE + 2 or More
</xsl:when>
<xsl:when test="$vCoverageOption = 13">
EE + 3 or More
</xsl:when>
<xsl:when test="$vCoverageOption = 14">
EE + 5 or More
</xsl:when>
<xsl:when test="$vCoverageOption = 15">
Per Member
</xsl:when>
<xsl:when test="$vCoverageOption = 16">
EE + 1 or More
</xsl:when>
<xsl:when test="$vCoverageOption = 99">
N/A
</xsl:when>
<xsl:otherwise>
Other
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:table-cell>

<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<fo:block font-size="7pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vAmountDue"/>
</fo:block>
</fo:table-cell>
</fo:table-row>

<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker"></marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker">continued</marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>

<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker"></marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker">continued</marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>

<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="7pt" font-family="Tahoma, sans-serif">
<fo:leader />
</fo:block>
</fo:table-cell>
</fo:table-row>

<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:table>
<xsl:variable name="vNumFacturaCompleta" select="StatementIdentifier" />
<xsl:variable name="vPeriodo" select="Period" />
<xsl:variable name="vGrupo" select="GroupNumber" />
<xsl:variable name="vDivision" select="Division" />
<xsl:variable name="vNumFactura" select="substring-before($vNumFacturaCompleta, '-')"/>
<xsl:variable name="vTotalPremiums" select="CurrentPremiums" />
<xsl:variable name="vEnrollees" select="TotalCount" />
<fo:table-column column-width="50%"/>
<fo:table-column column-width="10%"/>
<fo:table-column column-width="40%"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="9pt" font-family="Tahoma, sans-serif">
Current premiums for group <xsl:value-of select="$vGrupo"/> division <xsl:value-of select="$vDivision"/> :
</fo:block>
<fo:block font-weight="bold" font-size="9pt" font-family="Tahoma, sans-serif">
Total number of enrollees: <xsl:value-of select="$vEnrollees"/>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="left" display-align="left" border-color="white" border-style="solid">
<fo:block font-weight="bold" font-size="9pt" font-family="Tahoma, sans-serif">
</fo:block>
<fo:block font-weight="bold" font-size="9pt" font-family="Tahoma, sans-serif">

</fo:block>
</fo:table-cell>
<fo:table-cell text-align="right" display-align="left" border-color="white" border-style="solid">
<xsl:if test="position() != last()" >
<fo:block font-weight="bold" font-size="9pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vTotalPremiums"/>
</fo:block>
</xsl:if>

<xsl:if test="position() = last()" >
<fo:block font-weight="bold" font-size="9pt" font-family="Tahoma, sans-serif">
<xsl:value-of select="$vTotalPremiums"/>
</fo:block>

</xsl:if>

</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker"></marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell>
<marker class-name="section.head.marker">continued</marker>
<fo:block/>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:if>
</xsl:for-each>
</xsl:template>


Thanks!
 
Old April 7th, 2013, 07:17 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Hi,

Hmmm this is your XSLT, I would prefer to see your FO. Nevertheless, I think I see whats going on. For starters table-markers are not supported in 1.0, but will be in the next release (correct me if I am wrong). You are going to have to use fo:retrieve-marker in your static-region to get this to work and fo:marker in your flow.

If you want the markers to have "continued" (for example) after the first page then you need to define your fo:conditional-page-master-reference in your master-layout.

If you are still having trouble, post a small FO file: (
Code:
use the code wrap when pasting i!t
Good Luck.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing Table in a Header or Footer sunny227 XSLT 13 March 12th, 2008 02:41 AM
Populate a List Box with Table Names & Table date hewstone999 Access VBA 1 February 27th, 2008 10:10 AM
Sort Table Columns by Table Header Attribute omrieliav XSLT 4 June 7th, 2006 01:05 AM
Fixing Header & Footer shazia1 CSS Cascading Style Sheets 3 July 4th, 2005 12:22 AM
Print multiple header & footer from Crystal Report ashu_gupta75 Classic ASP Professional 0 February 6th, 2004 03:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.