2012-01-20 38 views
1

我在列标题区域中有列标题,我想冻结并使细节带(在显示实际数据的位置)可滚动。如何冻结iReport/Jasper报告中的列标题

这里是列标题代码段

<columnHeader> 
    <band height="36" splitType="Stretch"> 
     <staticText> 
      <reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="1410" y="0" width="113" height="34" isRemoveLineWhenBlank="true" forecolor="#404040" backcolor="#BBD7EF"/> 
      <textElement> 
       <font fontName="Trebuchet MS" size="13" isBold="true"/> 
      </textElement> 
      <text><![CDATA[Extra Hrs Amount]]></text> 
     </staticText> 
     <staticText> 
      <reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="1616" y="0" width="90" height="34" isRemoveLineWhenBlank="true" forecolor="#404040" backcolor="#BBD7EF"/> 
      <textElement> 
       <font fontName="Trebuchet MS" size="13" isBold="true"/> 
      </textElement> 
      <text><![CDATA[Parking Fees]]></text> 
     </staticText> 
     <staticText> 
      <reportElement stretchType="RelativeToBandHeight" mode="Opaque" x="1798" y="0" width="92" height="34" isRemoveLineWhenBlank="true" forecolor="#404040" backcolor="#BBD7EF"/> 
      <textElement> 
       <font fontName="Trebuchet MS" size="13" isBold="true"/> 
      </textElement> 
      <text><![CDATA[Net Payment]]></text> 
     </staticText> 
    </band> 
</columnHeader> 
+0

你可以发布的代码段和小说明你如何做,因为它不清楚... – Anil

+0

@Vinay你谈论xls文档? –

+0

不,HTML报告 – n92

回答

0

这里是您的解决方案比在代码中<staticText>字段 x轴..ie X =“1410” Y =“0”以下的报告x轴片段。将x轴值减小到您的要求x =“10”y =“3”。该文本将显示在列标题

+0

它如何帮助“冻结”列标题? –

+0

宽度和高度属于乐队的组成部分,但文本字段的x轴和y轴不属于组件,而是将组件放置在坐标中。x坐标中的移动场不会出现任何异常,因此它会以精确的方式呈现外部乐队协调我们提到但在PDF中不可见的内容,因此它也不会显示任何异常。 – Anil

+0

可能乐队的宽度超过1800 px ...我们并不确切知道 –