I have a report that only uses 1 record, but has about 200 fields.
The DETAILS BAND should span several pages. However I cannot lay out this report, because the constraint that the DETAILS BAND height must be < REPORT PAGE height.
I've seen suggestions about using GROUP HEADERS instead. However the
<group name="PERSONAL_INFO" isStartNewPage="true">
is NOT starting a new page when I use the iReport PREVIEW. Very frustrating...
Can someone please post an XML SAMPLE of how GROUP HEADERS should be setup to span multiple pages?
Below is my simple attempt to use the Group Headers to split out to new pages, but its NOT WORKING?!?!
GAK?! any help?
<?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="report name" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty">
<parameter name="CONS1_HEADER" class="java.lang.String"/>
<parameter name="App_DealerName" class="java.lang.String"/>
<group name="VEH_INFO" isStartNewPage="true">
<groupExpression><![CDATA[$P{App_DealerName}]]></groupExpression>
<groupHeader>
<band height="50">
<staticText>
<reportElement x="0" y="0" width="100" height="20"/>
<textElement/>
<text><![CDATA[VEHICLE INFO]]></text>
</staticText>
<textField hyperlinkType="None">
<reportElement x="144" y="0" width="256" height="24"/>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{App_DealerName}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
</group>
<group name="PERSONAL_INFO" isStartNewPage="true">
<groupExpression><![CDATA[$P{CONS1_HEADER}]]></groupExpression>
<groupHeader>
<band height="50">
<staticText>
<reportElement x="0" y="0" width="100" height="20"/>
<textElement/>
<text><![CDATA[PERSONAL INFO]]></text>
</staticText>
<textField hyperlinkType="None">
<reportElement x="144" y="0" width="256" height="24"/>
<textElement>
<font size="14"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{CONS1_HEADER}]]></textFieldExpression>
</textField>
</band>
</groupHeader>
</group>
</jasperReport>
1 Answer:
Well the groups do just break the page if the result of groupexpression will change concerning to the previous record (so if a new group of records will start).
With just one record you wont get this working. :-(
So if you want to break the page you must insert a PageBreakElement (in iReport menu "edit" -> "insert PageBreakElement" at the desired position.
hth
C-Box