Jump to content
JasperReports Library 7.0 is now available ×

Page break with subreports


pablof

Recommended Posts

I have a main report wich contains 3 subreports. I can't get a page break after each subreport... I need the subreports in separate pages! Any ideas?

 

 

 

Thanks in advance!

 

 

 

Here is the main jrxml(and it's attached):

 

 

 

<?xml version="1.0" encoding="UTF-8" ?>

<!-- Created with iReport - A designer for JasperReports -->

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport

name="lst_dir_anexoActa"

columnCount="1"

printOrder="Vertical"

orientation="Landscape"

pageWidth="842"

pageHeight="595"

columnWidth="730"

columnSpacing="0"

leftMargin="56"

rightMargin="56"

topMargin="20"

bottomMargin="20"

whenNoDataType="NoPages"

isTitleNewPage="false"

isSummaryNewPage="false">

<property name="ireport.scriptlethandling" value="0" />

<property name="ireport.encoding" value="UTF-8" />

<import value="java.util.*" />

<import value="net.sf.jasperreports.engine.*" />

<import value="net.sf.jasperreports.engine.data.*" />

 

<parameter name="parametro_acta" isForPrompting="true" class="java.lang.String"/>

<parameter name="SUBREPORT_DIR" isForPrompting="false" class="java.lang.String">

<defaultValueExpression ><![CDATA["C:\JBuilderX\thirdparty\jakarta-tomcat-4.1.24-LE-jdk14\webapps\eva\jasper\"]]></defaultValueExpression>

</parameter>

<queryString><![CDATA[sELECT a.numero_acta

FROM ACTA a

WHERE id = $P{parametro_acta}]]></queryString>

 

<field name="numero_acta" class="java.lang.String"/>

 

 

<group name="subreport1" isStartNewPage="true" >

<groupExpression><![CDATA[null]]></groupExpression>

<groupHeader>

<band height="15" isSplitAllowed="true" >

<subreport isUsingCache="true">

<reportElement

x="0"

y="0"

width="730"

height="15"

key="subreport-1"/>

<subreportParameter name="parametro_acta">

<subreportParameterExpression><![CDATA[$P{parametro_acta}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="numero_acta">

<subreportParameterExpression><![CDATA[$F{numero_acta}]]></subreportParameterExpression>

</subreportParameter>

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "lst_dir_anexoActa_subr_1.jasper"]]></subreportExpression>

</subreport>

</band>

</groupHeader>

<groupFooter>

<band height="0" isSplitAllowed="false" >

</band>

</groupFooter>

</group>

<group name="subreport2" isStartNewPage="true" >

<groupExpression><![CDATA[null]]></groupExpression>

<groupHeader>

<band height="15" isSplitAllowed="true" >

<subreport isUsingCache="true">

<reportElement

x="0"

y="0"

width="730"

height="15"

key="subreport-2"

stretchType="RelativeToBandHeight"

positionType="Float"/>

<subreportParameter name="parametro_acta">

<subreportParameterExpression><![CDATA[$P{parametro_acta}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="numero_acta">

<subreportParameterExpression><![CDATA[$F{numero_acta}]]></subreportParameterExpression>

</subreportParameter>

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "lst_dir_anexoActa_subr_2.jasper"]]></subreportExpression>

</subreport>

</band>

</groupHeader>

<groupFooter>

<band height="0" isSplitAllowed="false" >

</band>

</groupFooter>

</group>

<group name="subreport3" isStartNewPage="true" >

<groupExpression><![CDATA[null]]></groupExpression>

<groupHeader>

<band height="15" isSplitAllowed="true" >

<subreport isUsingCache="true">

<reportElement

x="0"

y="0"

width="730"

height="15"

key="subreport-3"

positionType="Float"

printWhenGroupChanges="subreport2"/>

<subreportParameter name="parametro_acta">

<subreportParameterExpression><![CDATA[$P{parametro_acta}]]></subreportParameterExpression>

</subreportParameter>

<subreportParameter name="numero_acta">

<subreportParameterExpression><![CDATA[$F{numero_acta}]]></subreportParameterExpression>

</subreportParameter>

<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>

<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "lst_dir_anexoActa_subr_3.jasper"]]></subreportExpression>

</subreport>

</band>

</groupHeader>

<groupFooter>

<band height="0" isSplitAllowed="true" >

</band>

</groupFooter>

</group>

<background>

<band height="0" isSplitAllowed="true" >

</band>

</background>

<title>

<band height="0" isSplitAllowed="true" >

</band>

</title>

<pageHeader>

<band height="0" isSplitAllowed="true" >

</band>

</pageHeader>

<columnHeader>

<band height="0" isSplitAllowed="true" >

</band>

</columnHeader>

<detail>

<band height="0" isSplitAllowed="false" >

</band>

</detail>

<columnFooter>

<band height="0" isSplitAllowed="true" >

</band>

</columnFooter>

<pageFooter>

<band height="27" isSplitAllowed="true" >

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="0"

y="5"

width="209"

height="19"

forecolor="#000000"

backcolor="#FFFFFF"

key="textField"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement>

<font size="10"/>

</textElement>

<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="495"

y="5"

width="194"

height="19"

key="textField-1"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Right">

<font fontName="Helvetica" size="10"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA["Página " + $V{PAGE_NUMBER} + " de "]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None" hyperlinkTarget="Self" >

<reportElement

x="693"

y="5"

width="36"

height="19"

forecolor="#000000"

backcolor="#FFFFFF"

key="textField-2"/>

<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>

<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

<font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>

</textField>

</band>

</pageFooter>

<summary>

<band height="0" isSplitAllowed="true" >

</band>

</summary>

</jasperReport> [file name=lst_dir_anexoActa.jrxml size=7702]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/lst_dir_anexoActa.jrxml[/file]

Link to comment
Share on other sites

  • 2 months later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...