Jaspersoft Studio 6.20.0
Server 7.8.0
I have a Report with two subreports. The first one can take dynamic hight of the page.
The second one is this:
<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="TEST_NOTIZEN" pageWidth="595" pageHeight="842" whenNoDataType="NoPages" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="110febd2-dc25-46dd-b70c-f48ad6824150">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="XXXX"/>
<queryString language="SQL">
<![CDATA[select tabelle from appcode where tabelle < 10]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<columnHeader>
<band height="17" splitType="Stretch">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER} == 1]]></printWhenExpression>
<staticText>
<reportElement x="0" y="0" width="555" height="17" uuid="85bcb0de-4334-4825-832d-a703a61882d4">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Datum ]]></text>
</staticText>
<staticText>
<reportElement stretchType="ContainerHeight" x="80" y="0" width="1" height="17" uuid="7b654a9c-f3c9-4e2a-9c4e-a6a803a9ff60">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<leftPen lineWidth="0.5"/>
</box>
<text><![CDATA[]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="17" splitType="Stretch">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER} == 1]]></printWhenExpression>
<staticText>
<reportElement x="0" y="0" width="555" height="17" uuid="8db2b19c-86f1-4852-bf2c-dd7e3d6e7ec1">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<text><![CDATA[]]></text>
</staticText>
<staticText>
<reportElement stretchType="ContainerHeight" x="80" y="0" width="1" height="17" uuid="2482ede8-86aa-4495-af09-d3e2fccfaedc">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<box>
<leftPen lineWidth="0.5"/>
</box>
<text><![CDATA[]]></text>
</staticText>
</band>
</detail>
</jasperReport>
My goal is to fill the left space of the page, to get a grid where people can make some notes by hand, like in this Picture:
Report
To achiev this, the print when expression is set to $V{PAGE_NUMBER} == 1
This works fine and the textfields/the grid is only printed on page 1, but at the end, it always prints an additional empty page (as you can see in the image above, there’s a 2nd page which should not be there). If i put a page- or rowheader or footer these are printet on the empty page. But the additional page is also printed if there’s only the detail band.
The SQL query ist just a “pseudo” query which gives me enough rows to fill a whole page (first report can also be empty) .
I experimented for hours with all the properties but I couldn’t figure out how to get rid of that empty page.
What I have also tried is to put a Grid in de background band and set runToBottom="true"
. But the background is not printed if it is in a subreport…!?
Thanks in advance!
Frankie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.