Extra blank page after page with list - jasper-reports
Here is my JRXML On the second page I created a table using the nested list. In Preview in Jaspersoft Studio everything looks good, but after generating PDF on the page where my nested list is, an empty page is added. I have no idea how I can fix this problem.
I tried:
Remove Line When Blank - for lists and fields.
When No Data Type - all options tried and tested.
I have a problem with generating an additional blank page in PDF. Our company system does not support generating reports from subreports to multiple pages. As a workaround, a 43 page printout was created and each page is divided by "Page Break". This works well. My data source is an XML file.
I've tried to solve previously given here in similar problems but it doesn't help.
I don't want to generate this empty page.
Part of nested list code:
<componentElement>
<reportElement x="0" y="240" width="555" height="40" uuid="5a5114e6-f143-4e73-9a70-6aa3285b4d31">
</reportElement>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="OrderItems" uuid="a5783264-74e9-43b2-8312-84e805170f06">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("/wstxns1:XML/wstxns1:p7_Object/wstxns1:productOrder/wstxns1:items")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="40" width="555">
<textField>
<reportElement style="Table_TD" x="0" y="0" width="185" height="20" uuid="9f67e274-92bc-4a21-8403-d60b4115c5c3">
</reportElement>
<textElement>
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{prospect/name}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Table_TD" x="185" y="0" width="185" height="20" uuid="262d8477-4cdc-47dc-b746-b38793e05757">
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalReccuringChargeAmount}!=null)?(new BigDecimal($F{totalReccuringChargeAmount}).setScale(2, BigDecimal.ROUND_HALF_UP)).toString() + " " + $F{totalReccuringChargecurrency}:""]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Table_TD" x="370" y="0" width="185" height="20" uuid="a9aad9d3-9269-427e-b0e7-032f582c44e7">
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{commitmentPeriod[Level0]}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement x="0" y="20" width="555" height="20" isRemoveLineWhenBlank="true" uuid="96c06463-aaa8-4ee9-80be-0110bbc8258c">
</reportElement>
<jr:list printOrder="Vertical">
<datasetRun subDataset="OrderItems" uuid="100d9171-37f5-45fc-b7b8-affe80e508af">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).dataSource("//wstxns1:items[wstxns1:itemId = '"+$F{itemId}+"']/wstxns1:configuration/wstxns1:prospect/wstxns1:children/wstxns1:items")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="555">
<textField>
<reportElement style="Table_TD" x="0" y="0" width="185" height="20" uuid="1e3d8870-3a1f-4cd2-923d-ac1547d5805f">
</reportElement>
<textElement>
<font fontName="SansSerif" size="9"/>
</textElement>
<textFieldExpression><![CDATA["--"+$F{prospect/name}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Table_TD" x="185" y="0" width="185" height="20" uuid="8dee85a5-406b-4a81-ab42-1d29ade1ceab">
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="9"/>
</textElement>
<textFieldExpression><![CDATA[($F{totalReccuringChargeAmount}!=null)?(new BigDecimal($F{totalReccuringChargeAmount}).setScale(2, BigDecimal.ROUND_HALF_UP)).toString() + " " + $F{totalReccuringChargecurrency}:""]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Table_TD" x="370" y="0" width="185" height="20" uuid="80044161-2cc9-461d-bb6b-4b7426d9479c">
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{commitmentPeriod[Level1]}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</jr:listContents>
</jr:list>
</componentElement>
<textField>
<reportElement style="Table_TH" positionType="Float" x="185" y="280" width="185" height="30" backcolor="#D9D9D9" uuid="9e550a00-d376-4f3d-859e-9f3ebd875b76">
</reportElement>
<box>
<pen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[($F{mainOrderTotalAmount}!=null)?(new BigDecimal($F{mainOrderTotalAmount}).setScale(2, BigDecimal.ROUND_HALF_UP)).toString()+" "+$F{mainOrderCurrency}:" "]]></textFieldExpression>
</textField>
<staticText>
<reportElement style="Table_TH" positionType="Float" x="0" y="280" width="185" height="30" backcolor="#D9D9D9" uuid="aa918c59-db11-49ad-8ab1-1e296b8e8b08">
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<text><![CDATA[Total: ]]></text>
</staticText>
<staticText>
<reportElement style="Table_CH" x="0" y="210" width="185" height="30" backcolor="#D9D9D9" uuid="5e3cea42-8937-4876-9ef3-4fef54ae66db">
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<text><![CDATA[Package name]]></text>
</staticText>
<staticText>
<reportElement style="Table_CH" x="185" y="210" width="185" height="30" backcolor="#D9D9D9" uuid="a76bf537-65a0-400f-a75a-b0f03bd88796">
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<text><![CDATA[Monthly charge]]></text>
</staticText>
<staticText>
<reportElement style="Table_CH" x="370" y="210" width="185" height="30" backcolor="#D9D9D9" uuid="6893b476-bcc2-42ab-8078-364f13b6fcf6">
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="9" isBold="true"/>
</textElement>
<text><![CDATA[Contract period]]></text>
</staticText>
<staticText>
<reportElement x="0" y="750" width="555" height="40" uuid="eb235aed-5c5e-4ef3-b9ab-f776e5307aa9">
</reportElement>
<textElement>
<font fontName="SansSerif" size="9"/>
</textElement>
<text><![CDATA[O749504]]></text>
</staticText>
</band>
Any ideas guys? Maybe you need more details?
Maybe this will help you:
Set the split Typ of the detail band to Stretch:
splitType="Stretch"
best wishes
We had a similar problem. If the a list was the last item in the page in same cases a blank page was added.
When we added the whole list to a new band the empty page disappeared.
Related
How to wrap to text when text is long [duplicate]
This question already has answers here: Stretch with overflow Detail band not working as expected (2 answers) Closed 2 years ago. I have made a report In which I want to wrap words When the text is longer than the line But the result is the text has been entered below the line Causing all results to be out of line. How to...... <detail> <band height="20" splitType="Stretch"> <textField> <reportElement stretchType="RelativeToTallestObject" x="259" y="2" width="48" height="17"/> <textElement textAlignment="Center" verticalAlignment="Top"> <font fontName="AngsanaUPC" size="13" pdfFontName="AngsanaUPC" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{TRDATE}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="312" y="2" width="113" height="17"/> <textElement verticalAlignment="Middle"> <font fontName="AngsanaUPC" size="13" pdfFontName="AngsanaUPC" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression><![CDATA[$F{LOCATION}]]></textFieldExpression> </textField> <textField> <reportElement x="426" y="2" width="58" height="17"/> <textElement verticalAlignment="Middle"> <font fontName="AngsanaUPC" size="14" pdfFontName="AngsanaUPC" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{SAVENAME}]]></textFieldExpression> </textField> <textField> <reportElement x="486" y="2" width="59" height="17"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="AngsanaUPC" size="13" pdfFontName="AngsanaUPC" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{SAVEDATE}]]></textFieldExpression> </textField> <line> <reportElement x="10" y="18" width="535" height="1"/> <graphicElement> <pen lineWidth="0.25"/> </graphicElement> </line> <textField> <reportElement x="11" y="1" width="33" height="17"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="AngsanaUPC" size="13" pdfFontName="AngsanaUPC" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{SEQ}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true"> <reportElement x="47" y="2" width="212" height="16"/> <textElement verticalAlignment="Middle"> <font fontName="AngsanaUPC" size="13" pdfFontName="AngsanaUPC" pdfEncoding="Identity-H" isPdfEmbedded="true"/> </textElement> <textFieldExpression><![CDATA[$F{COURSENAME}]]></textFieldExpression> </textField> </band> </detail> Example output for report: Desired result:
Select all the elements in the band and set Stretch type = "Relative to Tallest Objest"
Text Field dynamic height in JasperReports 6.12.2
I'm currently working in a API that will generate reports (with JasperReports 6.12.2), in this case I have to print a large String in a text field, the problem is that I can't give the appropiate behaviour to this element to adjust the height to the String size. I've been searching before to ask, and all that I've found was about the property isStretchWithOverflow="true", but isn't working for me because in my version this is deprecated and replaced with textAdjust="StretchHeight" so basically all the results finish with the same, the text is cutted by the text field. Note: Also I have to say that this necessity of dynamism is because i need to paginate the report. Element Text Field JRXML code: <textField textAdjust="StretchHeight"> <reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="190" width="555" height="321" isPrintWhenDetailOverflows="true"/> <textFieldExpression><![CDATA[$P{text}]]></textFieldExpression> </textField> Complete Band Detail JRXML code: <detail> <band height="802" splitType="Stretch"> <textField> <reportElement x="0" y="40" width="140" height="20" uuid="8e0ef27f-45c4-45f5-8c36-93e126db95db"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.codigo}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="60" width="140" height="20" uuid="6cfe8e0b-0b7d-47f5-be4e-4c94d7f19fac"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.fecha}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="80" width="140" height="20" uuid="c8508fc6-3b17-4bcc-a207-2a9beff32263"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.enviado}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="100" width="140" height="20" uuid="5f7c732e-aeee-4896-bf11-dbd8f2c2b02f"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.asunto}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="120" width="140" height="20" uuid="71f51ac1-63c5-4abb-909a-3f31b14e0e80"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.canal}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="140" width="140" height="20" uuid="00e9ac8d-c331-429d-944a-240e6abf2107"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.nombre}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="160" width="140" height="20" uuid="4b22fdfb-36a3-41da-86d1-a527ca67667d"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.texto}]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="40" width="405" height="20" uuid="bc346e06-c225-4451-bde7-67bde39d402e"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <textFieldExpression><![CDATA[$P{codigo}]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="60" width="405" height="20" uuid="1d0ac2a4-fcb9-4ad3-9d9d-db440ae5cfb3"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <textFieldExpression><![CDATA[new SimpleDateFormat("dd/MM/yyyy hh:mm:ss").format( new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse($P{fAlta}))]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="80" width="405" height="20" uuid="d0189a13-4ded-45a1-82ad-5896a50f7fbf"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <textFieldExpression><![CDATA[$P{mailPara}]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="100" width="405" height="20" uuid="b0cfff7f-9230-4351-a59c-bf550fc4f0c2"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <textFieldExpression><![CDATA[$P{asunto}]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="140" width="405" height="20" uuid="15f48c57-404d-47e2-94a9-26da75054aa9"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <textFieldExpression><![CDATA[$P{operador}]]></textFieldExpression> </textField> <staticText> <reportElement x="150" y="120" width="405" height="20" uuid="0926440c-f596-47a4-b7b4-674faa82b407"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <text><![CDATA[Operador ATC]]></text> </staticText> <textField> <reportElement x="0" y="20" width="140" height="20" uuid="664930ad-64a1-44fc-9cdb-4ef34eb7cffa"/> <textElement> <font fontName="SansSerif" size="11" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$R{respuesta.cuerpo.idPeticionATC}]]></textFieldExpression> </textField> <textField> <reportElement x="150" y="20" width="405" height="20" uuid="d9303c25-1ea8-45ca-b4b7-984a0b95d4ee"/> <textElement> <font fontName="SansSerif" size="11"/> </textElement> <textFieldExpression><![CDATA[$P{idPeticionATC}]]></textFieldExpression> </textField> <textField textAdjust="StretchHeight"> <reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="190" width="555" height="321" isPrintWhenDetailOverflows="true" uuid="0e59dd92-0a62-453a-9167-6a9d5b43ff54"/> <textFieldExpression><![CDATA[$P{text}]]></textFieldExpression> </textField> </band>
After a while trying to solve this issue I've found the problem. Recently Jasper Reports upgraded the version to v6.11 (Published: 2019-Dec-12), in this version Jaspersoft® Studio changed the property isstretchwithoverflow is replaced by textAdjust, so the problem was related with the version, and I realized that my Jasper reports library was in an older version v6.2, where the propertie textAdjust doesn't even exist. So if anyone else is having this problem, please, check your library version, if it's under version 6.11 and your editor plugin is version 6.11 or higher, you will not be able to overflow texts and paginate properly.
The property isStretchWithOverflow was replaced in the JasperReports Library 6.10.0 by the textAdjust property. So to achieve the dynamic stretching effect, you need to set textAdjust="StretchHeight". If you set your compatibility settings in Jaspersoft Studio ("Window > Preferences > Jaspersoft Studio > Compatibility") accordingly, it will automatically change the property to the compatible version, i.e. textAdjust="StretchHeight" will automatically be exchanged for isStretchWithOverflow="true" when you select a version <= JasperReports 6.5.1.
Jasper CSV Export Adding Extra Comma On The Last Row
I am using CSV Exporter and getting these rows. As you can see there is an extra comma in the bottom row. 361,,"$ 20,008,000",,,"$ 101,050.36",,Iowa,,"$ 55,424",,$ 279.92,,51,48,,50 336,,"$ 20,111,000",,,"$ 79,444.16",,Massachusetts,,"$ 59,854",,$ 236.44,,51,48,,50 340,,"$ 21,988,000",,,"$ 71,521.48",,Minnesota,,"$ 64,671",,$ 210.36,,50,48,,49 346,,"$ 22,566,000",,,"$ 84,231.26",,Nevada,,"$ 65,220",,$ 243.44,,51,47,,49 347,,"$ 30,167,000",,,"$ 91,036.54",,North Carolina,,"$ 86,937",,$ 262.35,,50,49,,50 1,,"$ 500,000",,,"$ 2,500.00",,Pennsylvania,,"$ 500,000",,"$ 2,500.00",,49,0,,49 5,,"$ 980,000",,,"$ 4,345.32",,Tennessee,,"$ 196,000",,$ 869.06,,47,65,,58 352,,"$ 25,236,000",,,"$ 86,870.26",,Texas,,"$ 71,693",,$ 246.79,,49,48,,49 354,,"$ 27,026,000",,,"$ 97,053.16",,Virginia,,"$ 76,345",,$ 274.16,,49,47,,48 15250,,,"$ 1,121,193,000",,,"$ 4,521,167.29",,"$ 73,521",,$ 296.47,,,50,49,50, The jrxml for the bottom row is as follows. Can someone please tell me what needs to be adjusted here? Thanking you <group name="mygroup"> <groupFooter> <band height="123"> <rectangle> <reportElement mode="Opaque" x="1" y="1" width="558" height="23" backcolor="#00CC99" /> </rectangle> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement stretchType="RelativeToBandHeight" x="0" y="28" width="553" height="86" /> <textElement> <font fontName="Times New Roman" size="7" isBold="false"/> </textElement> <textFieldExpression><![CDATA[$P{Disclosure}]]></textFieldExpression> </textField> <textField evaluationTime="Report" pattern="$ #,##0" isBlankWhenNull="true"> <reportElement mode="Transparent" x="49" y="2" width="80" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{sumFaceAmount}]]></textFieldExpression> </textField> <textField evaluationTime="Report" pattern="" isBlankWhenNull="true"> <reportElement mode="Transparent" x="0" y="2" width="48" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{sumCounts}]]></textFieldExpression> </textField> <textField evaluationTime="Report" pattern="$ #,##0.00" isBlankWhenNull="true"> <reportElement mode="Transparent" x="385" y="2" width="80" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{avgPremium}]]></textFieldExpression> </textField> <textField evaluationTime="Report" pattern="$ #,##0.00" isBlankWhenNull="true"> <reportElement mode="Transparent" x="130" y="2" width="85" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{sumPremium}]]></textFieldExpression> </textField> <textField evaluationTime="Report" pattern="$ #,##0" isBlankWhenNull="true"> <reportElement mode="Transparent" x="304" y="2" width="80" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{avgFaceAmount}]]></textFieldExpression> </textField> <textField evaluationTime="Report" isBlankWhenNull="true"> <reportElement mode="Transparent" x="533" y="2" width="25" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{Avg_Tage}]]></textFieldExpression> </textField> <textField evaluationTime="Report" isBlankWhenNull="true"> <reportElement mode="Transparent" x="507" y="2" width="26" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{Avg_Fage}]]></textFieldExpression> </textField> <textField evaluationTime="Report" isBlankWhenNull="true"> <reportElement mode="Transparent" x="478" y="2" width="28" height="14" forecolor="#000000" /> <textElement textAlignment="Center" verticalAlignment="Middle"> <font fontName="Times New Roman" size="10" isBold="true"/> </textElement> <textFieldExpression><![CDATA[$V{Avg_Mage}]]></textFieldExpression> </textField> </band> </groupFooter> </group>
How can I set table colspan?
My question is that how I can set colspan value for a table footer column in iReport, in jrxml file. I have to use iReport to create easily my PDF design. I send fields and parameters values from PHP via Tomcat. I don't use Java for create a dynamic jasper report. That means I have to resolve my problem from jrxml. Is it possible to make it?
You can't do a colspan as such but you can group the table columns in iReport (select more than 1 column in the table footer). Then remove the cells of the individual columns in the footer and add a cell for the "Group Header" in the footer. All pure iReport/JRXML.
Detail part of xml: <detail> <band height="43" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="344" height="20"/> <box> <bottomPen lineWidth="0.5"/> </box> <textElement verticalAlignment="Middle"> <font isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{data_title}]]></textFieldExpression> </textField> <componentElement> <reportElement key="table" x="0" y="20" width="802" height="20"/> <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> <datasetRun subDataset="details"> <datasetParameter name="credit"> <datasetParameterExpression><![CDATA[$F{credit}]]></datasetParameterExpression> </datasetParameter> <datasetParameter name="debit_gross_sum"> <datasetParameterExpression><![CDATA[$F{debit_gross_sum}]]></datasetParameterExpression> </datasetParameter> <datasetParameter name="debit_net_sum"> <datasetParameterExpression><![CDATA[$F{debit_net_sum}]]></datasetParameterExpression> </datasetParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{details})]]></dataSourceExpression> </datasetRun> <jr:column width="12"> <jr:tableFooter height="15" rowSpan="1"/> <jr:detailCell height="20" rowSpan="1"/> </jr:column> <jr:column width="48"> <jr:tableFooter height="15" rowSpan="1"/> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="48" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{time}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="106"> <jr:tableFooter height="15" rowSpan="1"/> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="106" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{description}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="130"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="130" height="15"/> <box> <bottomPen lineWidth="0.5"/> </box> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="130" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{guest_name}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="48"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="48" height="15"/> <box> <bottomPen lineWidth="0.5"/> </box> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="48" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{room}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="79"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="79" height="15"/> <box> <bottomPen lineWidth="0.5"/> </box> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="79" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{cachier_user}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="77"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="77" height="15"/> <box> <bottomPen lineWidth="0.5"/> </box> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="77" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{source_room}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="126"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="126" height="15"/> <box> <bottomPen lineWidth="0.5"/> </box> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="126" height="20"/> <textElement> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{source_guest_name}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="70"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="70" height="15"/> <box rightPadding="0"> <topPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <textElement textAlignment="Right"> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{debit_gross_sum}]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="70" height="20"/> <textElement textAlignment="Right"> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{debit_gross}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="70"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="70" height="15"/> <box rightPadding="0"> <topPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <textElement textAlignment="Right"> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{debit_net_sum}]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="70" height="20"/> <textElement textAlignment="Right"> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{debit_net}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="37"> <jr:tableFooter height="15" rowSpan="1"> <textField isBlankWhenNull="true"> <reportElement x="0" y="0" width="37" height="15"/> <box> <topPen lineWidth="0.5"/> <bottomPen lineWidth="0.5"/> </box> <textElement textAlignment="Right" verticalAlignment="Top"> <font pdfEncoding="Cp1250"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$P{credit}]]></textFieldExpression> </textField> </jr:tableFooter> <jr:detailCell height="20" rowSpan="1"/> </jr:column> </jr:table> </componentElement> </band> </detail> I would like to close up from tableFotter 3. cell 4 cells. Thank you Alex K!
JasperReports: Headers Not In The Same Line
The header of the report consists 10 elements it should look like this: |1 2 3 4 5 6 7 8 9 10| |--------------------| In reality it look like this: |1 2 8 9 10| |---3 4 5 6 7 ------| Is this something to do with the verticalAligment? I have set it to Bottom. The snippet from my jrxml file: <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="39" isSplitAllowed="true" > <rectangle> <reportElement x="0" y="1" width="780" height="30" backcolor="#999999" key="rectangle-1"/> <graphicElement stretchType="NoStretch"/> </rectangle> <staticText> <reportElement x="0" y="0" width="40" height="30" key="staticText-1"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Holder Id]]></text> </staticText> <staticText> <reportElement x="40" y="0" width="50" height="30" key="staticText-2"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Shell Id ]]></text> </staticText> <staticText> <reportElement x="100" y="1" width="50" height="30" key="staticText-3"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Product Id]]></text> </staticText> <staticText> <reportElement x="160" y="1" width="40" height="30" key="staticText-4"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[SPID]]></text> </staticText> <staticText> <reportElement x="200" y="1" width="40" height="30" key="staticText-5"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Loc- ation]]></text> </staticText> <staticText> <reportElement x="300" y="1" width="50" height="30" key="staticText-6"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Date]]></text> </staticText> <staticText> <reportElement x="350" y="1" width="30" height="30" key="staticText-7"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Normal Fare]]></text> </staticText> <staticText> <reportElement x="380" y="1" width="30" height="30" key="staticText-8"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Actual Fare]]></text> </staticText> <staticText> <reportElement x="410" y="1" width="40" height="30" key="staticText-9"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Currency Code]]></text> </staticText> <staticText> <reportElement x="450" y="1" width="30" height="30" key="staticText-10"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Staff Id]]></text> </staticText> <staticText> <reportElement x="250" y="1" width="40" height="30" key="staticText-11"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Dest- ination]]></text> </staticText> <staticText> <reportElement x="750" y="0" width="30" height="30" key="staticText-12"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[ISAM Seq.]]></text> </staticText> <staticText> <reportElement x="700" y="0" width="50" height="30" key="staticText-13"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[ISAM Id]]></text> </staticText> <staticText> <reportElement x="670" y="0" width="30" height="30" key="staticText-14"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Trans. Type]]></text> </staticText> <staticText> <reportElement x="630" y="1" width="40" height="30" key="staticText-15"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[CPICC]]></text> </staticText> <staticText> <reportElement x="510" y="1" width="30" height="30" key="staticText-16"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Conc. Auth]]></text> </staticText> <staticText> <reportElement x="480" y="1" width="30" height="30" key="staticText-17"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Suppl. Info.]]></text> </staticText> <staticText> <reportElement x="540" y="1" width="40" height="30" key="staticText-18"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Trans. Seq. No]]></text> </staticText> <staticText> <reportElement x="580" y="1" width="40" height="30" key="staticText-19"/> <box></box> <textElement verticalAlignment="Bottom"> <font size="8"/> </textElement> <text><![CDATA[Rem. Uses]]></text> </staticText> </band> </columnHeader>
Without seeing your JRXML file, the best guess would be one (or combination) of two things: You do not have the vertical alignment set to Bottom for the fields 1,2,8,9,10. You do not have the same height set for 1,2,8,9,10. In addition to those two, you do not have the tops set at the same Top value set for all the elements. Again this is all a best guess without being able to see your JRXML. If it is not one of those you will need to post it, so we can help.
I have tried the stretch type, position type, flot etc.... bottom, asTallest, all sort of thing, it seems nothing worked what I did was to change the height of the which around all me header ReportElements from 39 to 20 and each height from 30 to 15 increase some width, make sure they are wide enough the height 15 kind of forced the texts to stay in one line, give them no space to float, I feel its a kind of ugly fix, my instinct tells me it must not be the greatest solution, but it works and I need finish it by today. free to post answers, I will accept yours if it works, and much more elegant.
please see the Y Position. It is not same for all heading. you give Y position 0 for 1, 2, 8, 9, 10 and y=1 for remaing item. please make sure all position is same.