如何创建一个永久标题每页重复

如何解决如何创建一个永久标题每页重复

我想在XSLT 1.0文档的每一页上重复一个部分。这是一个Shipworks模板FWIW,所以我不确定就输出而言可用的选项。

当前仅显示在顶部:

<table style="width:{$pageWidth};">
    <tr>
       <td style="text-align: center;"> <font style="font-family:Free 3 of 9; font-size:36pt;  font-weight:normal;">*<xsl:value-of select="//Order/Number" />*</font></td></tr>
        <tr><td style="width:100%; color: white; background-color: #C0C0C0; text-align: center; font: bold 12pt; border: 1px solid black; padding: 1px;">Invoice
        </td>
    </tr>
</table>

但我希望它在打印时显示在每个页面上。有什么想法吗?

这是完整的代码:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sw="http://www.interapptive.com/shipworks" extension-element-prefixes="sw">

    <!-- Imports -->
    <xsl:import href="System\Snippets" />

    <xsl:output method="html" encoding="utf-8" indent="yes" />

    <!-- Start of template -->
    <xsl:template match="/"><xsl:apply-templates /></xsl:template>
    <xsl:template match="ShipWorks">

    <!-- Controls display of thumbnail images -->
    <xsl:variable name="thumbnailsEnabled" select="false()" />
    <xsl:variable name="thumbnailWidth" select="'50px'" />
    <xsl:variable name="thumbnailHeight" select="'50px'" />

    <!-- Width defined by the template PageSettings -->
    <xsl:variable name="pageWidth" select="concat(Template/Output/ContentWidth,' in')" />

    <!-- Default font.  Specified as a variable since GMail and Outlook behave differently. -->
    <xsl:variable name="pageFont" select="'font-family: Arial; font-size: 8pt;'" />

    <!-- These styles are used on multiple td's so to avoid copy\paste errors they are defined once here.  We have to do this since GMail doesn't support <style> in the <head>.  -->
    <xsl:variable name="orderDetailHeaderStyle" select="'border: 1px solid dimgray; background-color: #F3F3F3; font-weight: bold; padding: 3px;'" />
    <xsl:variable name="orderDetailAttributeStyle" select="'color: #808080; padding: 0px 8px 2px 2px;'" />
    <xsl:variable name="orderChargeStyle" select="'white-space: nowrap; text-align: right; padding: 1px 8px 3px 16px;'" />

    <html>
    <head>
        <title>Invoice</title>

        <style>
            body,table { <xsl:value-of select="$pageFont" /> }
        </style>

    </head>

    <body style="{$pageFont}">

        <xsl:variable name="orderCount" select="count(Customer/Order)" />
        <xsl:if test="$orderCount = 1">

        <xsl:variable name="order" select="Customer/Order[1]" />

        <table style="width:{$pageWidth};">
            <tr>
               <td style="text-align: center;"> <font style="font-family:Free 3 of 9; font-size:36pt;  font-weight:normal;">*<xsl:value-of select="//Order/Number" />*</font></td></tr>
                <tr><td style="width:100%; color: white; background-color: #C0C0C0; text-align: center; font: bold 12pt; border: 1px solid black; padding: 1px;">Invoice
                </td>
            </tr>
        </table>

        <!--
            Store Address \ Order Number
        -->
        <table style="width:{$pageWidth}; margin: 6px 0px;">
            <tr>

            <td style="width: 100%;">

                <!-- Shared Snippet -->
                <xsl:call-template name="StoreHeading">
                    <xsl:with-param name="address" select="Store/Address" />
                </xsl:call-template>

            </td>

            <td style="vertical-align: top;">
                <table style="border: 1px solid dimgray;">
                <tr>
                    <td>

                    <table style="font-weight: bold;" cellspacing="0">
                        <tr>
                            <td style="padding-right: 2px; vertical-align: top;">Order:</td>
                            <td style="white-space: nowrap;">

                                <!-- Shared Snippet -->
                                <xsl:call-template name="OrderNumber">
                                    <xsl:with-param name="order" select="$order" />
                                </xsl:call-template>

                            </td>
                        </tr>
                        <tr>
                            <td style="padding-right: 2px;">Placed:</td>
                            <td style="white-space: nowrap;">

                                <!-- Builtin ShipWorks function -->
                                <xsl:value-of select="sw:ToShortDate($order/Date)" />

                            </td>
                        </tr>
                        <tr>
                            <td style="padding-right: 2px; vertical-align:top;">Shipping:</td>
                            <td style="white-space: nowrap;">

                                <!-- Builtin ShipWorks function -->
                                <xsl:value-of select="$order/RequestedShipping" />

                            </td>
                        </tr>
                    </table>

                    </td>
                </tr>
                </table>

            </td>
            </tr>
        </table>

        <!--
            Bill To \ Ship To
        -->
        <table style="width:{$pageWidth}; margin: 12px 0px;" cellspacing="0">
            <tr>

            <td style="width: 47.5%; padding: 1px; border: 1px solid dimgray; vertical-align: top;">

                <table style="width: 100%;" cellspacing="0">
                    <tr>
                        <td style="font-weight: bold; border-bottom: 1px solid dimgray; background-color: #F3F3F3; padding: 1px 5px;">
                            Ship To
                        </td>
                    </tr>

                    <tr>
                        <td style="padding: 4px 10px;">

                            <!-- Shared Snippet -->
                            <xsl:call-template name="InvoiceShipTo">
                                <xsl:with-param name="order" select="$order" />
                            </xsl:call-template>

                        </td>
                    </tr>
                </table>

            </td>

            <td style="width: 5%; border:0"> </td>

            <td style="width: 47.5%; padding: 1px; border: 1px solid dimgray; vertical-align: top;">

                <table style="width: 100%;" cellspacing="0">
                    <tr>
                        <td style="font-weight: bold; border-bottom: 1px solid dimgray; background-color: #F3F3F3; padding: 1px 5px;">
                            Bill To
                        </td>
                    </tr>

                    <tr>
                        <td style="padding: 4px 10px;">

                            <!-- Shared Snippet -->
                            <xsl:call-template name="InvoiceBillTo">
                                <xsl:with-param name="order" select="$order" />
                            </xsl:call-template>

                        </td>
                    </tr>
                </table>

            </td>
            </tr>
        </table>

        <br />

        <!--
            Line Items
        -->
        <table style="width:{$pageWidth}; margin: 0px 0px -6px 0px; border-collapse: collapse;" cellspacing="0">

            <tr>

                <!-- The variables controlling thumbnails are up near the top of the template. -->
                <xsl:if test="$thumbnailsEnabled">
                    <td style="{$orderDetailHeaderStyle}; width: {$thumbnailWidth};">Image</td>
                </xsl:if>

                <td style="{$orderDetailHeaderStyle}; width: 20%;">Item #</td>
                <td style="{$orderDetailHeaderStyle};">Name</td>
                <td style="{$orderDetailHeaderStyle};" align="right">QTY</td>
                <td style="{$orderDetailHeaderStyle};" align="right">Price</td>
                <td style="{$orderDetailHeaderStyle};" align="right">Total</td>
            </tr>

            <xsl:for-each select="$order/Item">
              <xsl:sort select="Name" order="ascending" /> 

                <!-- We shouldn't have to conditionally apply the topborder... but IE is broken. -->
                <xsl:variable name="orderDetailContentStyle">
                    padding: 4px 8px 4px 8px;
                    <xsl:if test="position() != 1">border-top: 1px solid lightgrey;</xsl:if>
                </xsl:variable>

                <tr>

                    <!-- The variables controlling thumbnails are up near the top of the template. -->
                    <xsl:if test="$thumbnailsEnabled">
                        <td style="{$orderDetailContentStyle};">
                            <xsl:if test="Thumbnail != ''">
                                <img src="{Thumbnail}" alt="" style="height:{$thumbnailWidth}; width:{$thumbnailHeight}; border:0;" />
                            </xsl:if>
                        </td>
                    </xsl:if>

                    <td style="{$orderDetailContentStyle};">
<!-- Shared Snippet -->
                        <xsl:call-template name="OrderItemCode">
                            <xsl:with-param name="item" select="." />
                        </xsl:call-template> 
                    </td>
                    <td style="{$orderDetailContentStyle};">
                        <xsl:value-of select="Name" />
                    </td>
                    <td style="{$orderDetailContentStyle};" align="right">
                        <xsl:value-of select="Quantity" />
                    </td>
                    <td style="{$orderDetailContentStyle};" align="right">
                        <xsl:value-of select="format-number(UnitPrice,'#,##0.00')" />
                    </td>
                    <td style="{$orderDetailContentStyle};" align="right">
                        <xsl:value-of select="format-number(UnitPrice * Quantity,##0.00')" />
                    </td>
              </tr>

                <!-- Displays any item attribuets that may exists -->
                <xsl:for-each select="Option">
                    <tr>
                        <xsl:if test="$thumbnailsEnabled">
                            <td></td>
                        </xsl:if>
                        <td></td>
                        <td>
                            <table style="width: 100%; margin-left: 30px;" cellspacing="0">
                                <tr>
                                    <td style="{$orderDetailAttributeStyle}; white-space: nowrap;">
                                        <xsl:value-of select="Name" />:
                                    </td>
                                    <td style="{$orderDetailAttributeStyle}; width: 100%;">
                                        <xsl:value-of select="Description" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <td></td>
                        <xsl:choose>
                            <xsl:when test="UnitPrice != 0">
                                <td style="{$orderDetailAttributeStyle};" align="right">
                                    <xsl:value-of select="format-number(UnitPrice,##0.00')" />
                                </td>
                                <td style="{$orderDetailAttributeStyle};" align="right">
                                    <xsl:value-of select="format-number(UnitPrice * ../Quantity,##0.00')" />
                                </td>
                            </xsl:when>
                            <xsl:otherwise>
                                <td></td>
                                <td></td>
                            </xsl:otherwise>
                        </xsl:choose>
                    </tr>
                </xsl:for-each>
            </xsl:for-each>

        </table>

        <hr size="1" align="left" style="color: lightgrey;  width:{$pageWidth}; margin: 0px 0px 5px 0px;" />

        <!--
            Totals
        -->
        <table style="width:{$pageWidth};" cellspacing="0">
            
            <!-- 
                Subtotal
            -->
            
                <tr>
                    <td style="{$orderChargeStyle}; width: 100%;">
                        Subtotal:
                    </td>
                    <td style="{$orderChargeStyle};">
                        <xsl:value-of select="format-number(sum($order/Item/Total),##0.00')" />
                    </td>
                </tr>
            
            <!--
                Order Charges
            -->
            
            <xsl:for-each select="$order/Charge">
                <tr>
                    <td style="{$orderChargeStyle}; width: 100%;">
                        <xsl:value-of select="Description" />:
                    </td>
                    <td style="{$orderChargeStyle};">
                        <xsl:value-of select="format-number(Amount,##0.00')" />
                    </td>
                </tr>
            </xsl:for-each>

            <!--
                Order Total
            -->

            <tr>
                <td style="{$orderChargeStyle}; font-weight: bold;  width: 100%;">Order Total:</td>
                <td style="{$orderChargeStyle}; font-weight: bold;">
                    <xsl:value-of select="format-number($order/Total,##0.00')" />
                </td>
            </tr>
        </table>
            
        <br />
            
        <!--
            Order Information section
        -->
        <table style="width:{$pageWidth}; border-collapse: collapse;" cellspacing="0">
            <tr>
                <td style="{$orderDetailHeaderStyle};">Order Information</td>
            </tr>
        </table>
                        
        <div style="margin-top: 6px; margin-left: 8px; ">
            
            <!--
                Shipment information and tracking
            -->
            <xsl:if test="count($order/Shipment[Status = 'Processed']) &gt; 0">
                
                <b>Shipping</b>
                <div style="margin: 3 0 10 8;">
                    
                    <xsl:for-each select="$order/Shipment[Status = 'Processed']">
                        
                            Shipped on <b><xsl:value-of select="sw:ToShortDate(ShippedDate)" /></b>
                            using <b><xsl:value-of select="ServiceUsed" /></b>: 
                        
                            <!-- Shared Snippet -->
                            <b><xsl:call-template name="TrackingLink" /></b>
                            <br />
                    </xsl:for-each>
                    
                </div>
                
            </xsl:if>
                
              <b>Packed by:</b>___________________<br />  <br />
            <!--
                Notes
            
            <b>Notes</b>
            <div style="width:{$pageWidth}; margin: 3 0 10 8;">
                
                <xsl:if test="not(count($order/Note[Visibility='Public']))">
                    <i>None</i>
                </xsl:if>
                
                <xsl:for-each select="$order/Note[Visibility='Public']">
                    <xsl:value-of select="Text" />
                    <br />
                </xsl:for-each>
    
            </div> -->     
            
            <b>Thank you!</b>
            <div style="width:{$pageWidth}; margin: 3 0 10 8;">
                Thank you for your purchase from <xsl:value-of select="Store/Address/Company" />!<br />
                If you have questions about your order please visit us online at <a href="{Store/Address/Website}"><xsl:value-of select="Store/Address/Website" /></a> or email us at <a href="mailto:{Store/Address/Email}"><xsl:value-of select="Store/Address/Email" /></a>.
            </div><br />
            <font size="5" color="#FF0000"><b>Take 10% off on your next order of $75 or more</b></font><br />
            <font size="3"><b>Use coupon code: ONLINE10</b></font> <br />
            <font size="2">Some brands and items are excluded. Valid online only. <u>No phone orders</u>. Please note,this coupon is for future orders <b>ONLY</b>. It cannot be applied to past,pending,processing,or shipped orders. <b>No exceptions</b>.</font><br /><br />
            <font size="3" color="#0896E9"><u>www.tridentflyfishing.com</u></font>
        <br /><br /><br /><br />
             <center><font size="3"><b>For return information,please visit <u>www.tridentflyfishing.com/returns/</u></b></font><br /><br /></center><br /><br />
    
     </div>
          
                        
        <!--
            This is the end of the test ensuring a single order 
        -->
        </xsl:if>

        <!-- If there is not just a single order its an error -->
        <xsl:if test="$orderCount != 1">
            <p>
                This template is designed to be per-order.  There are currently
                <xsl:value-of select="$orderCount" /> orders in the XML input source.
            </p>
            <p>
                Please adjust the template settings to be processed per-order.
            </p>
        </xsl:if>

    </body>

    </html>

    </xsl:template>
</xsl:stylesheet>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-