remove the white space from columnFooter because columnFooter is only shown on the last page on Jasper [duplicate] - jasper-reports

I have a report made in iReport. I included a textFieldExpression in the column footer. My problem is that even though the line is blank it still takes up the space of the height of the band and thus sending the rest of fields to another sheet.
The code that I have is the following:
<columnFooter>
<band height="12" splitType="Stretch">
<printWhenExpression><![CDATA[$F{descripcionComentario}!=null]]></printWhenExpression>
<textField>
<reportElement x="42" y="0" width="100" height="12" uuid="5a9cbe9d-486a-4dd4-a865-d421cd7366a6"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{descripcionComentario}]]></textFieldExpression>
</textField>
</band>
</columnFooter>

The columnFooter is not resizable at run time, you need to find another report structure to solve your issue.
The solution often is to use groups where you have access to the groupFooter band.

Related

Jasper Reports subreport text alignment is wrong only when in main report

When I preview my jasper subreport, text is aligned to the right (what I want).
But when it is used in the main report, text is aligned to the left
On both reports, per element styling is used, set in Jasper Studio.
The jrxml per element looks like...
<textElement textAlignment="Right" markup="html">
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{col_1_initials}]]> </textFieldExpression>
The element including the subreport looks like
<band height="161" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
<subreport isUsingCache="false" runToBottom="false">
<reportElement x="-20" y="0" width="595" height="161" uuid="4e6fb330-c43f-4d47-b7aa-6884dad63d14"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("weekPairs")]]></dataSourceExpression>
<subreportExpression><![CDATA["weeksubreport.jasper"]]></subreportExpression>
</subreport>
</band>
I'm not using report Style Templates because for a reason I can't diagnose, Jaspersoft Studio crashes instantly trying to assign a style template.
What about the main report ovverides the subreport text-aligment and what would I have to change in the source to fix this?
EDIT
In the report designer->properties of a jrxml file there is a checkbox for "Derive Attributes". I've tried that both on and off, but nothing changed.

Is there any possibility of getting some part of summary band data in one page and other part of summary band data in next page in jasper reports

I am working with jasper reports and i am getting the data well but my problem is i am getting the data in 2 to 3 pages summary band data is big and it is printing in a new page. I will show an image for better understanding.
and second page is
so my question now is there any possibility of getting some part of summary band in one page and other part in next page
This is achieved by using the <break> component when you like to have the page break. JRBreak API
es.
<summary>
<band height="68">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="73b59f4e-2a74-48ec-b152-ca705bb98fd8"/>
<textFieldExpression><![CDATA["Summary page 1"]]></textFieldExpression>
</textField>
<break>
<reportElement x="0" y="20" width="100" height="1" uuid="3aa84342-4219-47c2-9724-96284afcd9b3"/>
</break>
<textField>
<reportElement x="0" y="26" width="100" height="20" uuid="0306db4f-ba7f-4ff5-ac18-a9e5d42cdbda"/>
<textFieldExpression><![CDATA["Summary page 2"]]></textFieldExpression>
</textField>
</band>
</summary>
Note: If the summary band is to start on a new page is controlled by attribute isSummaryNewPage on the <jasperReport> tag
isSummaryNewPage="true" start summary band on new page
isSummaryNewPage="false", don't start the summary band on new page (if there is space on current page)
Make sure that there is no "Break" element accidentally added in the summary band.

Removing trailing 0 xml Ireport

I'm currently having trouble when producing an iReport, when I run the report it's giving me a weight of 29000.0kg but I require just 29000kg. I've tried different formats but I understand it might need changing in XML.
If anyone could point me in the right direction or assist me in changing this please comments
Currently this is the XML code that is against fields:
<textFieldExpression><![CDATA[$F{EquipmentTareWeightKg} +"kg"]]></textFieldExpression>
Any ideas on how to include this?
I've figured this out, it doesn't require hardcoding but merely changed in the properties window within ireport designer, however if you see below, you change the pattern value to remove decimal places:
</textElement>
<textFieldExpression><![CDATA[$F{EquipmentLengthMm} /1000]]></textFieldExpression>
</textField>
<textField pattern="###0" isBlankWhenNull="true">
<reportElement x="399" y="0" width="32" height="20"/>
<textElement>
<font size="12"/>
</textElement>

How to prevent repeating data in JasperReports TextField

I am using JasperReports and have some problem with textField data continue on next page.
I have 3 textField in detail band.
Band splitType="Stretch".
Every textfiled has borders and isPrintWhenDetailOverflows param set "true".
When data in textfield does not fit on page it continues on next. So i need to print other textfileds of same band (because i need to print borders of every textfield)
But isPrintWhenDetailOverflows="true also leads to repeating data in other textfields on second page though their contents fits on first page.
Illustration:
The jasper report documentation says:
isPrintWhenDetailOverflows()
If this is set to true, the element will be reprinted on the next page if the band does not fit in the current page.
So I think it might be a problem. Remove isPrintWhenDetailOverflows="true". The two things isStretchWithOverflow="true" and stretchType="RelativeToTallestObject" are working for me in this case. So your textField will be like:
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement style="cell" stretchType="RelativeToTallestObject" x="266" y="0" width="266" height="15"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="9" isBold="false" pdfEncoding="Cp1251" isPdfEmbedded="true"/>
<paragraph leftIndent="2"/>
</textElement>
<textFieldExpression><![CDATA[$F{structure}]]></textFieldExpression>
</textField>

JasperReports: How to remove new page blank in subreport

I have create one report and put subreport into summary. I have problem to remove the new page blank in subreport because i have put clicks "run to bottom" in subreport's properties. After that, i run my report properly. The data appear correctly but problem comes when one new page blank appear after page. I don't know how to remove the blank page. Anyone know about this?
i know my mistakes is not put sub report by size band. Size band and sub ​​report must be the same size so that no blank page will come out.
I solve this adding the attribute isRemoveLineWhenBlank="true" for the reportElement tag:
<reportElement mode="Opaque" x="0" y="0" width="802" height="60" isRemoveLineWhenBlank="true" ...
And the band height, reportElement height and the subreport height must be equals:
<detail>
<band height="60" splitType="Stretch">
<subreport>
<reportElement mode="Opaque" x="0" y="0" width="802" height="60" ...