一个java fop做报表的问题请教高手解决!

来源:互联网 发布:钢结构桁架设计软件 编辑:程序博客网 时间:2024/05/18 18:01

fo:table-cell跨2行的操作结果始终不理想!还有table-cell自动换行字符太长容易跨边框界限!请教高手!

 

 <xsl:template match="ATTACH" mode="table">
   <fo:block font-size="12pt"
 font-family="{$font_family}"
 text-align="start" space-after.optimum="0.325in">
   </fo:block>
   <fo:block font-size="12pt"
      font-family="{$font_family}"
      font-weight="bold"
      background-color="{$header_background}"
      color="{$header_foreground}"                              
      text-align="left">
      <fo:block>发票代码:<xsl:value-of select="TOP/ORDER_ID/@Value"/><fo:inline color="white">补补补</fo:inline>商业公司采购合同号:<xsl:value-of select="TOP/DELIVER_SHEET_ID/@Value"/></fo:block>
    </fo:block>
 
  <fo:block>
     <fo:table table-layout="fixed" font-family="{$font_family}">
  <fo:table-column column-number="1"  column-width="16mm"/>
  <fo:table-column column-number="2"  column-width="16mm"/> 
  <fo:table-column column-number="3"  column-width="16mm"/>
  <fo:table-column column-number="4"  column-width="16mm"/>
  <fo:table-column column-number="5"  column-width="16mm"/>
  <fo:table-column column-number="6"  column-width="40mm"/>
  <fo:table-column column-number="7"  column-width="16mm"/>
  <fo:table-column column-number="8"  column-width="16mm"/>
  <fo:table-column column-number="9"  column-width="16mm"/>
  <fo:table-column column-number="10"  column-width="16mm"/>
  <fo:table-column column-number="11"  column-width="16mm"/>
  <fo:table-column column-number="12"  column-width="16mm"/>
  <fo:table-column column-number="13"  column-width="16mm"/>
       <fo:table-header>
   <fo:table-row text-align="left" background-color="{$header_background}" color="{$header_foreground}"  font-family="{$font_family}"  border="solid 1pt black" font-size="10pt">
      <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >库单位</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >新代码</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black"  number-rows-spanned="2"><fo:block text-align="center" >商品代码</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品名称</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品规格</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品单位</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品数量</fo:block></fo:table-cell>
   <fo:table-cell border="solid 0.5pt black" number-columns-spanned="2"><fo:block text-align="center" >进货价格</fo:block></fo:table-cell>
   <fo:table-cell border="solid 0.5pt black" number-columns-spanned="2"><fo:block text-align="center" >出货价格</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >差  额</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >入库日期</fo:block></fo:table-cell>
   </fo:table-row>
   <fo:table-row text-align="left" background-color="{$header_background}" color="{$header_foreground}" font-family="{$font_family}" border="solid 1pt black" display-align="center" font-size="10pt">
      <!--<fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >库单位</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >新代码</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black"  number-rows-spanned="2"><fo:block text-align="center" >商品代码</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品名称</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品规格</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品单位</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >商品数量</fo:block></fo:table-cell>
   --><fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" >商品单价</fo:block></fo:table-cell>
   <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" >商品金额</fo:block></fo:table-cell>
   <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" >商品单价</fo:block></fo:table-cell>
   <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" >商品金额</fo:block></fo:table-cell>
   <!--<fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >差  额</fo:block></fo:table-cell>
   <fo:table-cell display-align="center" border="solid 0.5pt black" number-rows-spanned="2"><fo:block text-align="center" >入库日期</fo:block></fo:table-cell>
   --></fo:table-row>
    </fo:table-header>
     <fo:table-body>
       <!--<fo:table-row text-align="left" background-color="{$header_background}" color="{$header_foreground}" font-family="{$font_family}" border="solid 1pt black" font-size="11pt">
         <fo:table-cell border="solid 0.5pt white" background-color="{$header_background}"  number-columns-spanned="13">发票代码:<xsl:value-of select="BOTTOM/SUM/@Value"/>商业公司采购合同号:<xsl:value-of select="BOTTOM/SUM/@Value"/></fo:table-cell>
       </fo:table-row>
         --><xsl:apply-templates select="LINES" mode="table"/>
       </fo:table-body>
    </fo:table>
  </fo:block>
  <fo:block font-size="14pt"
 font-family="{$font_family}"
 text-align="right" space-after.optimum="0.125in">
  <fo:block>合计:<fo:inline color="white">补补补补补补补</fo:inline><xsl:value-of select="BOTTOM/SUM/@Value"/></fo:block>
   </fo:block>
   <fo:block font-size="14pt"
  font-family="{$font_family}"
  font-weight="bold"
  background-color="{$header_background}"
  color="{$header_foreground}"                              
  text-align="right">
  <fo:block>财务部门主管<fo:inline color="white">补补补补补补</fo:inline>计账<xsl:value-of select="BOTTOM/SUM/@Value"/>
  <fo:inline color="white">补补补补补</fo:inline>保管部门主管:<xsl:value-of select="BOTTOM/SUM/@Value"/><fo:inline color="white">补补补补补</fo:inline>验收:<xsl:value-of select="BOTTOM/SUM/@Value"/>
  <fo:inline color="white">补补补补补</fo:inline>制单:<xsl:value-of select="BOTTOM/SUM/@Value"/><fo:inline color="white">补补补补</fo:inline></fo:block>
   </fo:block>
  </xsl:template> 
  <xsl:template match="LINES/SQL_RESULT" mode="table">
 <fo:table-row text-align="left" background-color="{$header_background}" color="{$header_foreground}" font-family="{$font_family}" border="solid 0.5pt black" font-size="10pt">
     <fo:table-cell border="solid 0.5pt black" ><fo:block font-weight="bold" text-align="center" ></fo:block></fo:table-cell>
        <fo:table-cell border="solid 0.5pt black" ><fo:block font-weight="bold" text-align="center" ><xsl:value-of select="SEQ/@Value"/></fo:block></fo:table-cell>
     <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="ITEM_ID/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="LEGACY_ITEM_ID/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="ITEM_NAME/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="ITEM_MODEL/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="NET_WEIGHT/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="ITEM_UOM/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="YT_UNIT_PRICE/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="RELEASE_TOT_PRICE/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="COMMENTS/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="COMMENTS/@Value"/></fo:block></fo:table-cell>
  <fo:table-cell border="solid 0.5pt black" ><fo:block text-align="center" ><xsl:value-of select="COMMENTS/@Value"/></fo:block></fo:table-cell>
 </fo:table-row>
  </xsl:template> 

原创粉丝点击