2015-10-05 35 views
6

我正在創建顯示某些人名的碧玉報告。我需要顯示底部列表中的人數。即使在將「浮動列腳」設置爲true後,詳細信息和列腳註區域之間的差距

我面臨的問題是我在人員名單和「總人選」標籤之間出現小差距。

對於參考,請檢查下面的圖片:
Gap marked in red box

在開始的時候,列腳註漸漸顯示在頁面的末尾,留下了不少的差距。然後我發現幾個不錯的StackOverflow鏈接:

1)Issue with Column footer and Summary bands
2)Jasper Reports - how to get column footer to appear directly below details band

這表明設置 「浮動欄頁腳」 爲真。這樣做之後,差距縮小了,我的專欄頁腳幾乎低於細節帶。但是,如圖所示,仍然存在一些差距,我不知道如何去除。

編輯:這是我的JRXML文件:

<?xml version="1.0" encoding="UTF-8"?> 
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isFloatColumnFooter="true" uuid="b7718df8-d1d7-46e7-9a66-7d3fe24c720c"> 
    <parameter name="ReportName" class="java.lang.String"/> 
    <queryString> 
     <![CDATA[]]> 
    </queryString> 
    <field name="firstName" class="java.lang.String"> 
     <fieldDescription><![CDATA[firstName]]></fieldDescription> 
    </field> 
    <field name="id" class="java.lang.String"> 
     <fieldDescription><![CDATA[id]]></fieldDescription> 
    </field> 
    <field name="lastName" class="java.lang.String"> 
     <fieldDescription><![CDATA[lastName]]></fieldDescription> 
    </field> 
    <field name="middleName" class="java.lang.String"> 
     <fieldDescription><![CDATA[middleName]]></fieldDescription> 
    </field> 
    <title> 
     <band height="42" splitType="Stretch"> 
      <textField> 
       <reportElement x="0" y="0" width="555" height="42" uuid="b6eaae95-75f5-4b33-978b-8afd7f9ecfee"/> 
       <textElement textAlignment="Center" verticalAlignment="Middle"> 
        <font size="20"/> 
       </textElement> 
       <textFieldExpression><![CDATA[$P{ReportName}]]></textFieldExpression> 
      </textField> 
     </band> 
    </title> 
    <columnHeader> 
     <band height="20" splitType="Stretch"> 
      <staticText> 
       <reportElement x="0" y="0" width="32" height="20" uuid="3dfe1b88-b77c-465e-bc1d-d96223c69692"/> 
       <text><![CDATA[Sr. No.]]></text> 
      </staticText> 
      <staticText> 
       <reportElement x="32" y="0" width="188" height="20" uuid="96add808-7f90-405d-93fc-ae64596df9e3"/> 
       <textElement textAlignment="Center"/> 
       <text><![CDATA[First Name]]></text> 
      </staticText> 
      <staticText> 
       <reportElement x="220" y="0" width="188" height="20" uuid="dd5aa422-a23c-4a4c-a464-9e927503c342"/> 
       <textElement textAlignment="Center"/> 
       <text><![CDATA[Middle Name]]></text> 
      </staticText> 
      <staticText> 
       <reportElement x="408" y="0" width="147" height="20" uuid="e7894574-4f95-4a04-b54b-16f636dc453c"/> 
       <textElement textAlignment="Center"/> 
       <text><![CDATA[Last Name]]></text> 
      </staticText> 
     </band> 
    </columnHeader> 
    <detail> 
     <band height="20" splitType="Stretch"> 
      <textField> 
       <reportElement x="0" y="0" width="32" height="20" uuid="b0a9a50f-f275-4802-ba80-04559e57c75e"/> 
       <textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression> 
      </textField> 
      <textField> 
       <reportElement x="32" y="0" width="188" height="20" uuid="4ea4f73b-06bb-4553-848b-eecdc6be51b2"/> 
       <textElement textAlignment="Center"/> 
       <textFieldExpression><![CDATA[$F{firstName}]]></textFieldExpression> 
      </textField> 
      <textField> 
       <reportElement x="220" y="0" width="188" height="20" uuid="d2ea4610-7ee7-4921-babe-6d9040592843"/> 
       <textElement textAlignment="Center"/> 
       <textFieldExpression><![CDATA[$F{middleName}]]></textFieldExpression> 
      </textField> 
      <textField> 
       <reportElement x="408" y="0" width="147" height="20" uuid="045272ac-1387-49c6-a4e1-237725e08269"/> 
       <textElement textAlignment="Center"/> 
       <textFieldExpression><![CDATA[$F{lastName}]]></textFieldExpression> 
      </textField> 
     </band> 
    </detail> 
    <columnFooter> 
     <band height="20" splitType="Stretch"> 
      <staticText> 
       <reportElement x="0" y="0" width="79" height="20" uuid="5a71d074-89c3-4b70-ae90-840cb37b45e8"/> 
       <text><![CDATA[Total Candidates:]]></text> 
      </staticText> 
     </band> 
    </columnFooter> 
    <pageFooter> 
     <band height="54" splitType="Stretch"/> 
    </pageFooter> 
    <summary> 
     <band height="42" splitType="Stretch"/> 
    </summary> 
</jasperReport> 

任何建議將非常感激!

+0

也許你有一些空的組頁腳,很難說沒有看到jrxml ......,你也可以考慮使用組頁腳,並把你的總體選擇卡在那裏。 –

+0

@PetterFriberg我會嘗試使用組頁腳。感謝Petter的建議。 –

+0

//是你的答案在這裏:http://stackoverflow.com/questions/12377178/issue-with-column-footer-and-summary-bands –

回答

5
<summary> 
    <band height="0" splitType="Stretch"/> 
</summary> 

或完全刪除標籤。