Jasper Reports – How to prevent printing empty page

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!

New contributor

Frankie is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật