473,624 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ 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 5318
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
5691
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 : teal ; font-size : 75% ; color : white ;} This appears to create a full width bar in IE6/netscape7.1, and a small bar on the left in opera 7.11, which is placed at the bottom of the browser window, even though the content may be longer than the...
2
2473
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 and footers on every printed page. How can I do it? Some nice example would be reeeeally great! In header I want to put a picture, some text, and in footer I would like to have page counter and some small text displayed... I've heard...
3
4868
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 the best method? Do you have a sample of how to do this?
3
3144
by: mg | last post by:
Any articles and/or examples on adding header/footer to WebForm (C#) ?
3
6361
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 it even possible to do with a datalist or shud i use only a datagrid... any ideas or online samples/URLS would be greatly appreicated ... thanks for ur time Ben
0
1212
by: tshad | last post by:
I have a table which works fine using the following templates: ********************************************************************************** <asp:TemplateColumn HeaderText="Answer"> <ItemTemplate> <asp:Label id="lblAnswer" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Answer") %>'> </asp:Label> </ItemTemplate> <FooterTemplate> <asp:TextBox id="txtAnswer" runat="server"></asp:TextBox>
0
929
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. the only way i can think of is by adding an empty record into the dataset before populating. but was just wondering are there other ways Cheers,
2
18807
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
3258
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 doesn't work as I require.. in the .aspx 01: <asp:Table ID="itemListTable" runat="server"> 02: <asp:TableHeaderRow ID="itemListTableHeader" runat="server" >
0
1071
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 AddNew linkbutton,a new row should be created with two textboxes and one Save Button at the footer of the webgrid. I have created the AddNew link button at the footer Now if I click the link 2 textboxes and one save button should be created...
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.