2015-10-05 8 views
6

Sto creando un report jasper che mostra alcuni nomi di persone. Devo mostrare il numero di persone nella lista in basso.Divario tra i dettagli e le colonne del footer colonna anche dopo aver impostato "Float Column Footer" su true

Il problema che sto affrontando è che sto ottenendo un piccolo divario tra la lista delle persone e l'etichetta "Total Candidates".

Per il riferimento, si prega di controllare sotto immagine:
Gap marked in red box

In principio, piè di pagina della colonna è stato sempre mostrato alla fine della pagina, lasciando un sacco di gap. Poi ho trovato alcuni buoni collegamenti StackOverflow:

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

che hanno suggerito di impostare "Float Column piè di pagina" a true. Dopo averlo fatto, il divario si è ridotto e il mio piè di pagina colonna è quasi al di sotto della banda di dettaglio. Ma ancora, come mostrato nella figura, c'è ancora un po 'di lacune, che non so come rimuovere.

Edit: Ecco il mio file di 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> 

Ogni suggerimento sarà molto apprezzato!

+0

Forse hai un po 'di footer di gruppo vuoto, difficile da dire senza vedere il jrxml ..., puoi anche considerare di usare il footer di gruppo e posizionare il tuo totale candiated lì. –

+0

@PetterFriberg Proverò ad usare il footer di gruppo. Grazie Petter per il suggerimento. –

+0

// sì la tua risposta è qui: http://stackoverflow.com/questions/12377178/issue-with-column-footer-and-summary-bands –

risposta

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

oppure rimuovere completamente il tag.

Problemi correlati