473,471 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

adding a footer in xsl fo

178 New Member
Hi,

I am trying to add page numbers to my document in xsl fo. I can get the page numbers to work but I need them to show at the bottom of each page. I know you can define an area as region-after but don't know how. Heres my xsl file so far.

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO-8859-1" ?> 
  2. <xsl:stylesheet version="1.0"
  3.       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.       xmlns:fo="http://www.w3.org/1999/XSL/Format"
  5.       xmlns:xlink="http://www.w3.org/1999/xlink">
  6.   <xsl:output method="xml" indent="yes"/>
  7.   <xsl:template match="/">
  8.     <fo:root>
  9.       <fo:layout-master-set>
  10.         <fo:simple-page-master master-name="A4"
  11.               page-height="29.7cm" page-width="21.0cm" margin="1cm">
  12.           <fo:region-body/>
  13.         </fo:simple-page-master>
  14.  
  15.       </fo:layout-master-set>
  16.  
  17.       <fo:page-sequence master-reference="A4">
  18.         <fo:flow flow-name="xsl-region-body">
  19.             <fo:block-container absolute-position="absolute"
  20.             top="-2cm" left="-3cm" width="670" height="947px"
  21.             background-image="file:background.gif">
  22.             <fo:block/>
  23.           </fo:block-container>
  24.  
  25.               <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-before="5px">
  26.                 Date: <xsl:value-of select="quote/project/date"/>
  27.               </fo:block>
  28.               <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-before="5px">
  29.                 Project Manager: <xsl:value-of select="quote/project/proj_manager"/>
  30.               </fo:block>
  31.             <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-before="1cm">
  32.                 <xsl:value-of select="quote/project/comp_name"/>
  33.               </fo:block>
  34.               <fo:block font-family="Helvetica" font-size="18pt" text-align="end" space-after="20cm">
  35.                   <xsl:value-of select="quote/project/project_name"/>
  36.               </fo:block>
  37.  
  38.               <fo:block font-family="Helvetica" font-size="10pt" text-align="center" space-before="3cm">
  39.                 18 Derryloran Industrial Estate
  40.               </fo:block>
  41.               <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
  42.                 Sandholes Road
  43.               </fo:block>
  44.               <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
  45.                 Cookstown
  46.               </fo:block>
  47.               <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
  48.                 Co. Tyrone
  49.               </fo:block>
  50.               <fo:block font-family="Helvetica" font-size="10pt" text-align="center">
  51.                 Tel: (028) 8676 1141    Fax: (028) 8676 9732    Email: info@tes-ni.com
  52.               </fo:block>
  53.  
  54.               <!-- Nextpage: Quote -->
  55.                <fo:block break-before="page" space-before="2in" space-after="2in">
  56.  
  57.                  <fo:block text-align="center" space-before="2cm" font-weight="bold" font-size="18pt">
  58.                 PANELS
  59.                 </fo:block>
  60.                 <fo:table space-before="1cm">
  61.                   <fo:table-body>
  62.                   <xsl:for-each select="quote/panels/panel">
  63.                         <fo:table-row>
  64.                       <fo:table-cell padding="6pt">
  65.                         <fo:block text-align="start"><xsl:value-of select="panel_name"/></fo:block>
  66.                       </fo:table-cell>
  67.                       <fo:table-cell padding="6pt">
  68.                         <fo:block text-align="end" space-after="2cm">£<xsl:value-of select="totalcost"/></fo:block>
  69.                       </fo:table-cell>
  70.                     </fo:table-row>
  71.                     </xsl:for-each>
  72.                     <fo:table-row>
  73.                         <fo:table-cell>
  74.                             <fo:block text-align="start" font-weight="bold" border-top="0.5pt solid red">Sub Total</fo:block>
  75.                         </fo:table-cell>
  76.                         <fo:table-cell>
  77.                             <fo:block font-weight="bold" text-align="end" border-top="0.5pt solid red">£<xsl:value-of select="sum(quote/panels/panel/totalcost)"/></fo:block>
  78.                         </fo:table-cell>
  79.                         </fo:table-row>
  80.                         </fo:table-body>
  81.                 </fo:table>
  82.  
  83.  
  84.  
  85.  
  86.                     <fo:block text-align="center" space-before="2cm" font-weight="bold" font-size="18pt">
  87.                 ADDITIONAL ITEMS
  88.                 </fo:block>
  89.                     <fo:table space-before="1cm">
  90.                   <fo:table-body>
  91.                         <xsl:for-each select="quote/project/extras/item">
  92.                         <fo:table-row>
  93.                         <fo:table-cell padding="6pt">
  94.                             <fo:block text-align="start"><xsl:value-of select="ex_item"/></fo:block>
  95.                         </fo:table-cell>
  96.                         <fo:table-cell padding="6pt">
  97.                             <fo:block text-align="end">£<xsl:value-of select="ex_cost"/></fo:block>
  98.                         </fo:table-cell>
  99.                         </fo:table-row>
  100.                         <fo:table-row>
  101.                         <fo:table-cell padding="6pt" number-columns-spanned="2">
  102.                             <fo:block font-style="italic" text-align="start"><xsl:value-of select="ex_description"/></fo:block>
  103.                         </fo:table-cell>
  104.                         </fo:table-row>
  105.                         </xsl:for-each>
  106.                         <fo:table-row>
  107.                         <fo:table-cell>
  108.                             <fo:block text-align="start" font-weight="bold" border-top="0.5pt solid red">Sub Total</fo:block>
  109.                         </fo:table-cell>
  110.                         <fo:table-cell>
  111.                             <fo:block font-weight="bold" text-align="end" border-top="0.5pt solid red">£<xsl:value-of select="sum(quote/project/extras/item/ex_cost)"/></fo:block>
  112.                         </fo:table-cell>
  113.                         </fo:table-row>
  114.                   </fo:table-body>
  115.                 </fo:table>
  116.                 <fo:table space-before="1cm">
  117.                   <fo:table-body>
  118.                   <fo:table-row>
  119.                         <fo:table-cell>
  120.                             <fo:block text-align="start" font-weight="bold" border-top="0.5pt solid red" font-size="18pt">Total Cost</fo:block>
  121.                         </fo:table-cell>
  122.                         <fo:table-cell>
  123.                             <fo:block font-weight="bold" text-align="end" border-top="0.5pt solid red" font-size="18pt">£<xsl:value-of select="sum(quote/project/extras/item/ex_cost)+sum(quote/panels/panel/totalcost)"/></fo:block>
  124.                         </fo:table-cell>
  125.                         </fo:table-row>
  126.                   </fo:table-body>
  127.                 </fo:table>
  128.                 </fo:block>
  129.  
  130.                 <fo:block text-align="center">Page <fo:page-number/></fo:block>
  131.  
  132.  
  133.                 <!-- Nextpage: Quotation Terms -->
  134.                    <fo:block break-before="page" space-before="2in" space-after="2in">
  135.                    <fo:block text-align="start" space-before="2cm" font-size="18pt" font-weight="bold">
  136.                 PAYMENT TERMS
  137.                 </fo:block>
  138.                 <fo:block font-family="Helvetica" font-size="12pt" text-align="start" space-before="1cm">
  139.                 <xsl:value-of select="quote/project/extras/payment"/>
  140.                   </fo:block>
  141.  
  142.                 <fo:block text-align="start" space-before="2cm" font-size="18pt" font-weight="bold">
  143.                 DELIVERY TERMS
  144.                 </fo:block>
  145.                 <fo:block font-family="Helvetica" font-size="12pt" text-align="start" space-before="1cm">
  146.                 <xsl:value-of select="quote/project/extras/delivery"/>
  147.                   </fo:block>
  148.  
  149.                 <fo:block text-align="start" space-before="2cm" font-size="18pt" font-weight="bold">
  150.                 VALIDITY
  151.                 </fo:block>
  152.                 <fo:block font-family="Helvetica" font-size="12pt" text-align="start" space-before="1cm">
  153.                 <xsl:value-of select="quote/project/extras/valid_for"/>
  154.                   </fo:block>
  155.                    </fo:block>
  156.                    <fo:block text-align="center">Page <fo:page-number/></fo:block>
  157.  
  158.                    <!-- Nextpage: Our Company -->
  159.                    <fo:block break-before="page" space-before="2in" space-after="2in">
  160.                        <fo:block text-align="center" space-before="6cm" font-size="18pt" font-weight="bold">
  161.                     OUR COMPANY
  162.                     </fo:block>
  163.                     <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  164.                     TES are a multi-faceted company, working to the highest standard of engineering excellence.  Innovative and dynamic, TES are established in a number of industries offering professional and quality services to include;
  165.                     </fo:block>
  166.  
  167.  
  168.                     <fo:list-block space-before="1cm"> 
  169.                         <fo:list-item >
  170.                         <fo:list-item-label end-indent="label-end()" >
  171.                           <fo:block space-before="1cm">
  172.                           1)
  173.                           </fo:block>
  174.                         </fo:list-item-label>
  175.                         <fo:list-item-body start-indent="body-start()" >
  176.                         <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  177.                             Mechanical and Electrical Services to the Water Treatment Industry
  178.                         </fo:block>
  179.                         </fo:list-item-body>
  180.                         </fo:list-item>
  181.  
  182.                         <fo:list-item >
  183.                         <fo:list-item-label end-indent="label-end()" >
  184.                           <fo:block space-before="1cm">
  185.                           2)
  186.                           </fo:block>
  187.                         </fo:list-item-label>
  188.                         <fo:list-item-body start-indent="body-start()" >
  189.                         <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  190.                             Design, manufacture and installation of electrical control panels
  191.                         </fo:block>
  192.                         </fo:list-item-body>
  193.                         </fo:list-item>
  194.  
  195.                         <fo:list-item >
  196.                         <fo:list-item-label end-indent="label-end()" >
  197.                           <fo:block space-before="1cm">
  198.                           3)
  199.                           </fo:block>
  200.                         </fo:list-item-label>
  201.                         <fo:list-item-body start-indent="body-start()" >
  202.                         <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  203.                             Integrated SCADA and PLC Software
  204.                         </fo:block>
  205.                         </fo:list-item-body>
  206.                         </fo:list-item>
  207.  
  208.                         <fo:list-item >
  209.                         <fo:list-item-label end-indent="label-end()" >
  210.                           <fo:block space-before="1cm">
  211.                           4)
  212.                           </fo:block>
  213.                         </fo:list-item-label>
  214.                         <fo:list-item-body start-indent="body-start()" >
  215.                         <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  216.                             Full range of bespoke Building Services Solutions
  217.                         </fo:block>
  218.                         </fo:list-item-body>
  219.                         </fo:list-item>
  220.                     </fo:list-block>
  221.                     <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  222.                     Committed to exceeding client expectations, TES, with our team of experienced designers and engineers remain focused on offering pioneering solutions and expert design services.  
  223.                     </fo:block>
  224.                     <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  225.                     Our Project Management team are renown for the skilled execution of professional engineering and management services ensuring that each project is delivered to the highest standard in a timely and efficient manner.
  226.                     </fo:block>
  227.                     <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  228.                     With a proven track record in the delivery of high value public and private sector projects, TES never fail to deliver.  Fully committed to deploying stringent Health and Safety Policies, Quality standards and Environmental procedures, TES are without question a socially responsible business.
  229.                     </fo:block>
  230.                     <fo:block text-align="justify" space-before="1cm" font-size="12pt">
  231.                     A fast-moving and forward thinking organisation, TES offer fully integrated engineering services in an expert and highly professional manner.  Our reputation exceeds us as offering a client-focused service through quality workmanship.  This is why our company mantra remains;
  232.                     </fo:block>
  233.                     <fo:block text-align="center" space-before="2cm" font-size="16pt" font-weight="bold">
  234.                     Quality Driven....Customer Focused
  235.                     </fo:block>
  236.                     <fo:block text-align="center">Page <fo:page-number/></fo:block>
  237.  
  238.                     <xsl:for-each select="quote/panels/panel">
  239.                     <!-- Nextpage: SVG Drawings -->
  240.                     <fo:block break-before="page">
  241.  
  242.                        <fo:instream-foreign-object>
  243.  
  244.                     <svg xmlns="http://www.w3.org/2000/svg" width="29.7cm" height="29.7cm" xml:space="preserve">
  245.  
  246.                         <g transform="rotate(-90)">
  247.                             <image xlink:href="{svgdrawing/text()}" x="-27cm" y="1cm" width="70cm" height="40cm"/> 
  248.  
  249.  
  250.                           </g>
  251.  
  252.                     </svg>
  253.  
  254.                     </fo:instream-foreign-object>
  255.  
  256.                        </fo:block>
  257.                     </xsl:for-each>
  258.  
  259.  
  260.  
  261.                    </fo:block>
  262.  
  263.  
  264.  
  265.         </fo:flow>
  266.  
  267.       </fo:page-sequence>
  268.  
  269.  
  270.  
  271.     </fo:root>
  272.   </xsl:template>
  273. </xsl:stylesheet>
Dec 19 '08 #1
1 5309
Dormilich
8,658 Recognized Expert Moderator Expert
I haven't done xsl-fo much, but that's the reference: XSL 1.1 – fo:region-after
Dec 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tony Benham | last post by:
I've added a footer div to a website, which I've positioned using div#footer {width : auto ; border : 0 ; position : absolute ; bottom : 0 ; margin : 1.33em 1.33em 1.33em 1.33em ; background :...
2
by: Dragan Kovac | last post by:
Hello everyone, I have a problem. I generated some kind of my own report (by building HTML file) and now I want to print it. Printing itself is not a problem, problem is with adding custom headers...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
3
by: mg | last post by:
Any articles and/or examples on adding header/footer to WebForm (C#) ?
3
by: anon | last post by:
Hi All, I would like to make a datalist which takes new information by allowing users(with some button or link) to add new rows to a datalist with some information and save the information.....is...
0
by: tshad | last post by:
I have a table which works fine using the following templates: ********************************************************************************** <asp:TemplateColumn HeaderText="Answer">...
0
by: Craig G | last post by:
how would i go about entering a blankitem into a combo box that resides in the footer of a Datagrid at runtime? the combo is already being populated on the page load using the prerender event. ...
2
by: a.mustaq | last post by:
Hi All, I want to add a new row in the footer of a grdview, which can accept input.Please help in acheiving this. Regards Mustaq Ahmed.A
2
by: Kevin Blount | last post by:
I'd like to create a script that adds rows to an existing table, which has a header and footer row. The new row should be added as the last row BEFORE the footer. Here's what I have, though it...
0
by: durga2005 | last post by:
Hi In my webgrid I have three columns namely “Type” and “Category” and “code” .But while inserting new record I will not enter “Code” Value since it is automatically generated. When I click the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.