Jasper Report not add multiple page - jasper-reports

I'm trying to create a report with multiple pages in jasper report to do it I read that it is necessary to insert a page break, when I insert the page break but the "jump" to the next page is not performed this the content always remains on the first page , how can i fix this?
Jasper file xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.17.0.final using JasperReports Library version 6.17.0-6d93193241dd8cc42629e188b94f9e0bc5722efd -->
<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="reportpreventivo" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3c08ffac-5031-449c-a58f-007dffeebf2f">
<import value="org.apache.commons.codec.binary.Base64"/>
<subDataset name="DataSetHeader" uuid="db6131ae-8b7b-429e-aaca-42479bc8befd">
<parameter name="Data" class="java.lang.String">
<parameterDescription><![CDATA[Data del preventivo]]></parameterDescription>
</parameter>
<parameter name="NRPreventivo" class="java.lang.String"/>
<parameter name="NSRif" class="java.lang.String"/>
<parameter name="Titolo" class="java.lang.String"/>
<parameter name="RagioneSociale" class="java.lang.String"/>
<parameter name="Oggetto" class="java.lang.String"/>
<parameter name="Testata" class="java.lang.String"/>
<parameter name="LogoBase64" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="Data" class="java.lang.String"/>
<field name="NSRif" class="java.lang.String"/>
<field name="VSRif" class="java.lang.String"/>
<field name="NRPreventivo" class="java.lang.String"/>
<field name="Titolo" class="java.lang.String"/>
<field name="RagioneSociale" class="java.lang.String"/>
<field name="Chiusura" class="java.lang.String"/>
<field name="Testata" class="java.lang.String"/>
<field name="Oggetto" class="java.lang.String"/>
<field name="LogoBase64" class="java.lang.String"/>
<variable name="Logo" class="java.lang.String"/>
</subDataset>
<subDataset name="DataSetTableValori" uuid="797e3017-223a-44f4-86f7-e13073e06538">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="NumeroCapitolo" class="java.lang.String"/>
<field name="Descrizione" class="java.lang.String"/>
<field name="Desc2" class="java.lang.String"/>
<field name="SottoCapitolo1" class="java.lang.String"/>
<field name="SottoCapitolo2" class="java.lang.String"/>
<field name="SottoCapitolo3" class="java.lang.String"/>
<field name="DescrizioneDis" class="java.lang.String"/>
<field name="CostoUnitario" class="java.lang.String"/>
<field name="Quantita" class="java.lang.String"/>
<field name="TotaleCap" class="java.lang.String"/>
<field name="DescrizioneEstesa" class="java.lang.String"/>
<field name="Tipologia" class="java.lang.String"/>
<field name="UM" class="java.lang.String"/>
<field name="PrezzoRiservato" class="java.lang.String"/>
<field name="Images" class="java.lang.String"/>
</subDataset>
<parameter name="Data" class="java.lang.String"/>
<parameter name="NRPreventivo" class="java.lang.String"/>
<parameter name="NSRif" class="java.lang.String"/>
<parameter name="VSRif" class="java.lang.String"/>
<parameter name="Titolo" class="java.lang.String"/>
<parameter name="RagioneSociale" class="java.lang.String">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="Indirizzo" class="java.lang.String"/>
<parameter name="Citta" class="java.lang.String"/>
<parameter name="Oggetto" class="java.lang.String"/>
<parameter name="Testata" class="java.lang.String"/>
<parameter name="LogoBase64" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="258">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.layout"/>
<image scaleImage="FillFrame">
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="-10" width="555" height="79" uuid="7fe6f2e0-3ba7-4424-9383-8d78bfe1cc21"/>
<imageExpression><![CDATA["http://centoimpianti.com/immagini/logo.png"]]></imageExpression>
</image>
<textField>
<reportElement x="30" y="128" width="500" height="130" uuid="a5a724e9-c81f-470a-8a83-9dd6bfbd823d"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Testata}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="30" y="228" width="500" height="30" uuid="089a3b80-f7df-461b-be75-bcad575bf4e9"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Oggetto}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="170" width="170" height="30" uuid="9174f886-5c23-4f99-9c97-86fb50f6eeb3"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Citta}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="140" width="170" height="30" uuid="ec9b01f4-bcb2-495f-9a54-efc48bb452c8"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Indirizzo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="110" width="170" height="30" uuid="caf5fd23-70c3-46d3-9de0-c5765c1ec5fc"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{RagioneSociale}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="75" width="100" height="15" uuid="7231c72c-d715-4bbe-8906-a27173f77220"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Titolo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="120" y="170" width="100" height="30" uuid="aac1e4b6-da6a-4e46-aa0f-c026896a3b86"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{VSRif}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="170" width="90" height="30" uuid="dc708ab1-3286-479d-ad0b-aaea351652b4"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Vs.Rif:]]></text>
</staticText>
<textField>
<reportElement x="120" y="140" width="100" height="30" uuid="1a11a6cc-5d1b-4994-bf10-3cc1de504d07"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{NSRif}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="140" width="90" height="30" uuid="c5dbd3b3-7263-43d5-a804-1a797635fe8a"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Nf.Rif:]]></text>
</staticText>
<textField>
<reportElement x="120" y="110" width="100" height="30" uuid="b0632e23-c54a-4edc-a264-23055af446a5"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{NRPreventivo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="90" width="90" height="30" uuid="c59e786f-e907-4bcd-93f3-a14d0b777d5c"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Nr Preventivo:]]></text>
</staticText>
<textField>
<reportElement x="70" y="75" width="100" height="15" uuid="29f6924b-5bd2-42f1-bd98-0090aed0d3eb"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Data}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="75" width="40" height="15" uuid="801816f2-1988-4b9e-9291-88d5a200d238"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Data:]]></text>
</staticText>
</band>
</title>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="277" splitType="Stretch">
<textField>
<reportElement x="470" y="220" width="100" height="30" uuid="980219d2-fe09-46a6-ad45-44b5a5d955dd"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<break>
<reportElement x="0" y="10" width="555" height="1" uuid="4c31b7fe-5ec5-49c1-b25b-86783bb78a04"/>
</break>
<componentElement>
<reportElement x="0" y="20" width="544" height="30" uuid="9eba7646-c8ff-4a47-9bdf-80e761574024"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="DataSetHeader" uuid="71f5f8c7-7482-43ce-9fb5-b7ae826aac48">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:listContents height="30" width="544">
<textField>
<reportElement x="0" y="0" width="10" height="30" uuid="f858cba9-20e9-4617-ab6c-bdc90729455f"/>
<textFieldExpression><![CDATA[$F{Data}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="10" y="0" width="10" height="30" uuid="c3ccd40f-c529-49ef-b06e-06f53ed59235"/>
<textFieldExpression><![CDATA[$F{NSRif}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="20" y="0" width="10" height="30" uuid="ee277db1-87e9-4d49-9a2c-ce3c31b758ac"/>
<textFieldExpression><![CDATA[$F{VSRif}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="30" y="0" width="10" height="30" uuid="98fa3e12-b8f6-4cb0-a68c-f8357cdf8145"/>
<textFieldExpression><![CDATA[$F{NRPreventivo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="40" y="0" width="10" height="30" uuid="c7f37047-c74b-458c-b067-d1fd24c9e1d3"/>
<textFieldExpression><![CDATA[$F{Titolo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="50" y="0" width="10" height="30" uuid="e7a1391b-a235-44d1-b40a-f1f84ba513aa"/>
<textFieldExpression><![CDATA[$F{RagioneSociale}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="60" y="0" width="10" height="30" uuid="d76e9074-d5a8-4329-b244-002ebef1395f"/>
<textFieldExpression><![CDATA[$F{Chiusura}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="70" y="0" width="10" height="30" uuid="aec60c88-6971-4d14-9e9d-f0499c048601"/>
<textFieldExpression><![CDATA[$F{Testata}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="80" y="0" width="10" height="30" uuid="a198722f-4da1-49dc-8788-4a4a12e12b0e"/>
<textFieldExpression><![CDATA[$F{Oggetto}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="0" width="10" height="30" uuid="3bd98713-7742-49bc-9a12-6c666cc6e809"/>
<textFieldExpression><![CDATA[$F{LogoBase64}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</pageFooter>
<summary>
<band height="155" splitType="Stretch"/>
</summary>
</jasperReport>

Your page break is in the band page footer, so it is always at the end of the page. If you want to break between some fields you have to put it in the right band and between those fields. Here is your example with break after "Nr Preventivo:"
<!-- Created with Jaspersoft Studio version 6.19.1.final using JasperReports Library version 6.19.1-867c00bf88cd4d784d404379d6c05e1b419e8a4c -->
<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="reportpreventivo" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="3c08ffac-5031-449c-a58f-007dffeebf2f">
<import value="org.apache.commons.codec.binary.Base64"/>
<subDataset name="DataSetHeader" uuid="db6131ae-8b7b-429e-aaca-42479bc8befd">
<parameter name="Data" class="java.lang.String">
<parameterDescription><![CDATA[Data del preventivo]]></parameterDescription>
</parameter>
<parameter name="NRPreventivo" class="java.lang.String"/>
<parameter name="NSRif" class="java.lang.String"/>
<parameter name="Titolo" class="java.lang.String"/>
<parameter name="RagioneSociale" class="java.lang.String"/>
<parameter name="Oggetto" class="java.lang.String"/>
<parameter name="Testata" class="java.lang.String"/>
<parameter name="LogoBase64" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="Data" class="java.lang.String"/>
<field name="NSRif" class="java.lang.String"/>
<field name="VSRif" class="java.lang.String"/>
<field name="NRPreventivo" class="java.lang.String"/>
<field name="Titolo" class="java.lang.String"/>
<field name="RagioneSociale" class="java.lang.String"/>
<field name="Chiusura" class="java.lang.String"/>
<field name="Testata" class="java.lang.String"/>
<field name="Oggetto" class="java.lang.String"/>
<field name="LogoBase64" class="java.lang.String"/>
<variable name="Logo" class="java.lang.String"/>
</subDataset>
<subDataset name="DataSetTableValori" uuid="797e3017-223a-44f4-86f7-e13073e06538">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="NumeroCapitolo" class="java.lang.String"/>
<field name="Descrizione" class="java.lang.String"/>
<field name="Desc2" class="java.lang.String"/>
<field name="SottoCapitolo1" class="java.lang.String"/>
<field name="SottoCapitolo2" class="java.lang.String"/>
<field name="SottoCapitolo3" class="java.lang.String"/>
<field name="DescrizioneDis" class="java.lang.String"/>
<field name="CostoUnitario" class="java.lang.String"/>
<field name="Quantita" class="java.lang.String"/>
<field name="TotaleCap" class="java.lang.String"/>
<field name="DescrizioneEstesa" class="java.lang.String"/>
<field name="Tipologia" class="java.lang.String"/>
<field name="UM" class="java.lang.String"/>
<field name="PrezzoRiservato" class="java.lang.String"/>
<field name="Images" class="java.lang.String"/>
</subDataset>
<parameter name="Data" class="java.lang.String"/>
<parameter name="NRPreventivo" class="java.lang.String"/>
<parameter name="NSRif" class="java.lang.String"/>
<parameter name="VSRif" class="java.lang.String"/>
<parameter name="Titolo" class="java.lang.String"/>
<parameter name="RagioneSociale" class="java.lang.String">
<parameterDescription><![CDATA[]]></parameterDescription>
</parameter>
<parameter name="Indirizzo" class="java.lang.String"/>
<parameter name="Citta" class="java.lang.String"/>
<parameter name="Oggetto" class="java.lang.String"/>
<parameter name="Testata" class="java.lang.String"/>
<parameter name="LogoBase64" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="259">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.layout"/>
<textField>
<reportElement x="30" y="128" width="500" height="130" uuid="a5a724e9-c81f-470a-8a83-9dd6bfbd823d"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Testata}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="30" y="228" width="500" height="30" uuid="089a3b80-f7df-461b-be75-bcad575bf4e9"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Oggetto}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="170" width="170" height="30" uuid="9174f886-5c23-4f99-9c97-86fb50f6eeb3"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Citta}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="140" width="170" height="30" uuid="ec9b01f4-bcb2-495f-9a54-efc48bb452c8"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Indirizzo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="110" width="170" height="30" uuid="caf5fd23-70c3-46d3-9de0-c5765c1ec5fc"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{RagioneSociale}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="360" y="75" width="100" height="15" uuid="7231c72c-d715-4bbe-8906-a27173f77220"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Titolo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="120" y="170" width="100" height="30" uuid="aac1e4b6-da6a-4e46-aa0f-c026896a3b86"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{VSRif}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="170" width="90" height="30" uuid="dc708ab1-3286-479d-ad0b-aaea351652b4"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Vs.Rif:]]></text>
</staticText>
<textField>
<reportElement x="120" y="140" width="100" height="30" uuid="1a11a6cc-5d1b-4994-bf10-3cc1de504d07"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{NSRif}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="140" width="90" height="30" uuid="c5dbd3b3-7263-43d5-a804-1a797635fe8a"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Nf.Rif:]]></text>
</staticText>
<textField>
<reportElement x="120" y="110" width="100" height="30" uuid="b0632e23-c54a-4edc-a264-23055af446a5"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{NRPreventivo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="90" width="90" height="30" uuid="c59e786f-e907-4bcd-93f3-a14d0b777d5c"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Nr Preventivo:]]></text>
</staticText>
<textField>
<reportElement x="70" y="75" width="100" height="15" uuid="29f6924b-5bd2-42f1-bd98-0090aed0d3eb"/>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{Data}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="30" y="75" width="40" height="15" uuid="801816f2-1988-4b9e-9291-88d5a200d238"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Data:]]></text>
</staticText>
<break>
<reportElement x="0" y="125" width="552" height="1" uuid="4c31b7fe-5ec5-49c1-b25b-86783bb78a04"/>
</break>
</band>
</title>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="277" splitType="Stretch">
<textField>
<reportElement x="470" y="220" width="100" height="30" uuid="980219d2-fe09-46a6-ad45-44b5a5d955dd"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement x="0" y="20" width="544" height="30" uuid="9eba7646-c8ff-4a47-9bdf-80e761574024"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="DataSetHeader" uuid="71f5f8c7-7482-43ce-9fb5-b7ae826aac48">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:listContents height="30" width="544">
<textField>
<reportElement x="0" y="0" width="10" height="30" uuid="f858cba9-20e9-4617-ab6c-bdc90729455f"/>
<textFieldExpression><![CDATA[$F{Data}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="10" y="0" width="10" height="30" uuid="c3ccd40f-c529-49ef-b06e-06f53ed59235"/>
<textFieldExpression><![CDATA[$F{NSRif}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="20" y="0" width="10" height="30" uuid="ee277db1-87e9-4d49-9a2c-ce3c31b758ac"/>
<textFieldExpression><![CDATA[$F{VSRif}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="30" y="0" width="10" height="30" uuid="98fa3e12-b8f6-4cb0-a68c-f8357cdf8145"/>
<textFieldExpression><![CDATA[$F{NRPreventivo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="40" y="0" width="10" height="30" uuid="c7f37047-c74b-458c-b067-d1fd24c9e1d3"/>
<textFieldExpression><![CDATA[$F{Titolo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="50" y="0" width="10" height="30" uuid="e7a1391b-a235-44d1-b40a-f1f84ba513aa"/>
<textFieldExpression><![CDATA[$F{RagioneSociale}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="60" y="0" width="10" height="30" uuid="d76e9074-d5a8-4329-b244-002ebef1395f"/>
<textFieldExpression><![CDATA[$F{Chiusura}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="70" y="0" width="10" height="30" uuid="aec60c88-6971-4d14-9e9d-f0499c048601"/>
<textFieldExpression><![CDATA[$F{Testata}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="80" y="0" width="10" height="30" uuid="a198722f-4da1-49dc-8788-4a4a12e12b0e"/>
<textFieldExpression><![CDATA[$F{Oggetto}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="90" y="0" width="10" height="30" uuid="3bd98713-7742-49bc-9a12-6c666cc6e809"/>
<textFieldExpression><![CDATA[$F{LogoBase64}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</pageFooter>
<summary>
<band height="155" splitType="Stretch"/>
</summary>
</jasperReport>

Related

jasper ireport subreport variable or main report variable main report variable duplicate print

I am new in jasper report, I used jasper ireport 5.6.0.
I have two reports main report or subreport and I returned variable value from subreport to the main report value successfully returned from subreport, but here is a problem I have faced:
When I have printed sub-report variable or sum in grand total with the main report, the main report variable total duplicate two print with subreport variable here below screenshot.
> mian report
<?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="printBillReport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" scriptletClass="com.reporter.jasper.ConvertToWord" uuid="bd072f9e-2dda-451a-b0a1-13e9f2aa0d3b">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["C:\\Users\\windows\\Documents\\NetBeansProjects\\SteplizerElectronics\\src\\steplizerelectronics\\"]]></defaultValueExpression>
</parameter>
<parameter name="cusID" class="java.lang.Integer"/>
<queryString>
<![CDATA[select *from sale where cus_id=$P{cusID}]]>
</queryString>
<field name="ID" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cat_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="model_no" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="user_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="comp_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_cell" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="sel_price" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="qty" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="amount" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="payable" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="borrow" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="status" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="regdate" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<variable name="amount_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{amount}]]></variableExpression>
</variable>
<variable name="qty_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{qty}]]></variableExpression>
</variable>
<variable name="borrow_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{borrow}]]></variableExpression>
</variable>
<variable name="payable_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{payable}]]></variableExpression>
</variable>
<variable name="grandTotall" class="java.lang.Double"/>
<variable name="total_amount" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[$F{amount}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="123" splitType="Stretch">
<staticText>
<reportElement x="137" y="80" width="66" height="20" uuid="3b4ea294-f433-491e-9803-2c36e8092e59"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Manufactur:]]></text>
</staticText>
<rectangle radius="10">
<reportElement x="1" y="1" width="555" height="118" uuid="f86b54e6-471d-4395-acda-da815bae56ae"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Double"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="10" y="113" width="112" height="3" uuid="f3df3b93-035d-4379-8635-c5947bdd4f62"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[14-DS Main Bund Road, Near Chohan Road, Islam Pura, Lahore.]]></text>
</staticText>
<line>
<reportElement x="310" y="97" width="1" height="19" uuid="fab4c957-2174-44a7-a773-945807f51b60"/>
</line>
<staticText>
<reportElement x="118" y="8" width="258" height="22" uuid="1bbc2106-275b-45be-ae87-cd4607dc8c04"/>
<textElement>
<font fontName="Audiowide" size="14"/>
</textElement>
<text><![CDATA[AONE ELECTRONICS FACTORY]]></text>
</staticText>
<image>
<reportElement x="1" y="3" width="102" height="68" uuid="94d07030-0eae-424a-a92e-b2c80f63d49e"/>
<imageExpression><![CDATA["C:\\Users\\windows\\Desktop\\aone.png"]]></imageExpression>
</image>
<staticText>
<reportElement x="11" y="71" width="48" height="16" uuid="52f2829b-19ca-4269-bec6-80bdb9951674"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Address:]]></text>
</staticText>
<staticText>
<reportElement x="285" y="99" width="83" height="14" uuid="85f72593-8c79-49ec-81b1-a266a1fbe68e"/>
<text><![CDATA[M/S]]></text>
</staticText>
<line>
<reportElement x="279" y="73" width="274" height="1" uuid="b0e7d11d-efc3-4833-a07b-bb5ffc4f3f63"/>
</line>
<line>
<reportElement x="279" y="74" width="1" height="44" uuid="c4a74d99-3a03-469d-972b-f4319ae837ec"/>
</line>
<staticText>
<reportElement x="396" y="-14" width="35" height="16" uuid="93706ffc-0443-4a0c-9a78-8ae0258beeca"/>
<text><![CDATA[Date]]></text>
</staticText>
<staticText>
<reportElement x="142" y="89" width="136" height="30" uuid="30a5b94f-a0a3-44d1-8e81-b8d5bdc70719"/>
<text><![CDATA[Automatic Voltage steplizer Regulators & UPS]]></text>
</staticText>
<componentElement>
<reportElement x="373" y="7" width="177" height="31" uuid="088518ef-edd8-4c30-a126-e9514f1b13d2"/>
<jr:barbecue xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" type="Code39 (Extended)" drawText="false" checksumRequired="false">
<jr:codeExpression><![CDATA[$F{cus_name}+$F{cus_id}]]></jr:codeExpression>
</jr:barbecue>
</componentElement>
<textField>
<reportElement x="321" y="98" width="234" height="16" uuid="edbc7887-c6f6-4209-bcf3-68ad5be80ec8"/>
<textFieldExpression><![CDATA[$F{cus_name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="143" y="73" width="60" height="16" uuid="abaf5bdb-61f6-4148-92c8-eafe2e5e6a9e"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Steplizers]]></text>
</staticText>
<staticText>
<reportElement x="285" y="77" width="100" height="16" uuid="c440daa7-1411-4e51-9750-6531b35acbd4"/>
<textElement>
<font size="11"/>
</textElement>
<text><![CDATA[Credit Sale]]></text>
</staticText>
</band>
</title>
<columnHeader>
<band height="27" splitType="Stretch">
<rectangle>
<reportElement x="1" y="0" width="552" height="26" uuid="ab9bb588-6c52-4e6f-858a-f64555e9c482"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="10" y="2" width="26" height="20" uuid="cee00939-18a0-43a9-8f7b-8ef37c3c8136"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[ID]]></text>
</staticText>
<staticText>
<reportElement x="69" y="3" width="100" height="20" uuid="c5555982-8ed2-486b-9b20-c820ea2d6303"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[PARTICULARS]]></text>
</staticText>
<staticText>
<reportElement x="334" y="2" width="68" height="20" uuid="444d348c-5aec-47d9-9b8b-8a0df7d5d9cc"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[UNIT RATE]]></text>
</staticText>
<staticText>
<reportElement x="416" y="2" width="31" height="20" uuid="e03d0e0f-fee8-48f6-b649-d29122dae87b"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement x="452" y="2" width="88" height="20" uuid="4b3c8b66-6b26-4b2c-bfa4-58917ad61092"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Amount Rs]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="18" splitType="Stretch">
<line>
<reportElement x="1" y="-1" width="1" height="18" uuid="46636ee5-05ef-4ed0-98b3-8b3cdb0e388b"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="50" y="-2" width="1" height="18" uuid="df3f7753-0f5e-4ff0-bf2c-a3ae8a1d29dc"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="325" y="-2" width="1" height="19" uuid="ff6ab656-efe5-47d2-b6cc-7560cef1f5f4"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="411" y="-1" width="1" height="18" uuid="c6ecd5da-b343-441e-983f-b2414fa30583"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="445" y="-1" width="1" height="18" uuid="0dabdb94-9868-4f7e-935a-0fa235ce0a13"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="553" y="-1" width="1" height="18" uuid="0bc274c2-5f26-4f5d-b68d-e21bc2c4c888"/>
<graphicElement>
<pen lineWidth="2.0" lineStyle="Solid"/>
</graphicElement>
</line>
<textField>
<reportElement x="10" y="1" width="26" height="14" uuid="63a319b2-8afe-4318-bab9-878b61ad4a82"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="70" y="1" width="255" height="14" uuid="cf463437-6041-457b-800b-b7d4917676f6"/>
<textElement verticalAlignment="Middle">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{cat_name}+", "+$F{model_no}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00">
<reportElement x="335" y="1" width="72" height="14" uuid="10d9300e-83f3-4942-836a-c547e02d8c7d"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{sel_price}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="417" y="1" width="32" height="14" uuid="d744148c-6afe-46dc-b14f-c1ba4d6859c0"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{qty}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00">
<reportElement x="452" y="1" width="89" height="14" uuid="b1d2ce72-c35f-4507-bb93-6f3e06b80a00"/>
<textElement verticalAlignment="Middle">
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{amount}]]></textFieldExpression>
</textField>
<line>
<reportElement x="50" y="-26" width="1" height="26" uuid="465616a8-77d2-4347-9290-149936abb9e7"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="325" y="-28" width="1" height="26" uuid="704a8402-1a4e-42a0-9ce3-673c8a9bc69b"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="411" y="-26" width="1" height="26" uuid="e4128970-6640-4c7b-9677-6b349dbfa0da"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Solid"/>
</graphicElement>
</line>
<line>
<reportElement x="445" y="-27" width="1" height="26" uuid="4a2e897b-cd91-4573-a76d-a4f32b4cd077"/>
<graphicElement>
<pen lineWidth="1.0" lineStyle="Double"/>
</graphicElement>
</line>
</band>
</detail>
<pageFooter>
<band height="39" splitType="Stretch">
<rectangle>
<reportElement x="-21" y="9" width="599" height="30" backcolor="#333333" uuid="8634a9b7-fcf3-4881-82c3-6679dbc18552"/>
</rectangle>
<staticText>
<reportElement x="141" y="15" width="244" height="12" forecolor="#FFFFFF" uuid="274941d4-cc0e-4fb4-997b-382c827badc9"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[Software Provided by Ph# +923024712782]]></text>
</staticText>
<staticText>
<reportElement x="142" y="27" width="244" height="12" forecolor="#FFFFFF" uuid="a4ff6425-a7f1-4fff-b0ab-a92da8a2dcb5"/>
<textElement>
<font size="9"/>
</textElement>
<text><![CDATA[www.ultronhouse.com]]></text>
</staticText>
<textField>
<reportElement x="434" y="18" width="80" height="20" forecolor="#FFFFFF" uuid="d1d8921f-151b-44c9-8d12-4b82cb993ffe"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="514" y="18" width="40" height="20" forecolor="#FFFFFF" uuid="f31b2a21-d3fd-470f-9527-f998b02be397"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="-1" y="17" width="100" height="20" forecolor="#FFFFFF" uuid="34d4b240-cfb4-41d0-af4e-815e9e099d74"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="315" splitType="Stretch">
<rectangle>
<reportElement x="326" y="0" width="228" height="80" uuid="51ca5430-c464-4742-a4d6-178c75f4f4f8"/>
<graphicElement>
<pen lineWidth="2.0"/>
</graphicElement>
</rectangle>
<rectangle>
<reportElement x="0" y="0" width="325" height="22" uuid="e65cff7a-3ed1-450f-bfa7-585c580cfe60"/>
<graphicElement>
<pen lineWidth="1.0"/>
</graphicElement>
</rectangle>
<textField pattern="">
<reportElement x="63" y="5" width="263" height="20" uuid="102cb181-c6f9-4bf5-98cc-50333c2f9efa"/>
<textElement>
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{REPORT_SCRIPTLET}.readNumber($V{amount_1})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="7" y="6" width="48" height="20" uuid="1d88c6eb-ba59-45f2-b1af-b5b1cf1634b0"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Ruppies:]]></text>
</staticText>
<line>
<reportElement x="327" y="60" width="226" height="1" uuid="95c9a5f3-5fed-4813-8bc1-076f9b658c09"/>
</line>
<staticText>
<reportElement x="333" y="3" width="77" height="20" uuid="fd70b399-0bf9-4840-87b9-c398765cd363"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Total]]></text>
</staticText>
<staticText>
<reportElement x="334" y="22" width="77" height="20" uuid="494a0fe7-85be-4220-9959-fbf09672ac68"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement x="334" y="61" width="110" height="20" uuid="fcb0a54c-5ecb-4e49-b7f0-0cd819c89a6c"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Grand Total]]></text>
</staticText>
<textField pattern="#,##0.00;#,##0.00-">
<reportElement x="453" y="3" width="100" height="20" uuid="62437a3a-407d-46a6-9531-4c445ecd0c98"/>
<textElement verticalAlignment="Top">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{amount_1}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;#,##0.00-">
<reportElement x="454" y="22" width="100" height="20" uuid="65b192d8-375b-4f1b-b90e-7802d3fdb6eb"/>
<textElement verticalAlignment="Top">
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{qty_1}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="#,##0.00;#,##0.00-">
<reportElement isPrintRepeatedValues="false" x="456" y="62" width="100" height="20" uuid="87f1c4f0-44ec-42a4-9416-527113afb9ed"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[($V{grandTotall}+$V{total_amount})-$V{total_amount}]]></textFieldExpression>
</textField>
<subreport>
<reportElement x="136" y="2" width="192" height="21" uuid="ffdec19a-5213-44a4-a6e4-a874bb2b6578"/>
<subreportParameter name="cusID">
<subreportParameterExpression><![CDATA[$F{cus_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<returnValue subreportVariable="grandTotall" toVariable="grandTotall"/>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "printBill_subreport.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement x="335" y="41" width="108" height="20" uuid="f4b88757-b2f9-4c43-abd2-1d458137016e"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Previous Balance]]></text>
</staticText>
<textField evaluationTime="Report" pattern="#,##0.00;(#,##0.00)">
<reportElement x="455" y="43" width="100" height="20" uuid="1ed3c932-ce63-4a21-9624-a60f22720620"/>
<textElement>
<font size="11" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{grandTotall}-$V{amount_1}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="86" y="60" width="100" height="20" uuid="d38785b9-638e-4e10-a9e2-b664205694e1"/>
<textFieldExpression><![CDATA[($V{total_amount}+1+$V{grandTotall})-$V{total_amount}]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>
Sub-report
<?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="printBill_subreport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="40d765ae-ceb6-47eb-a59b-aa232f876bb6">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="cusID" class="java.lang.Integer"/>
<queryString>
<![CDATA[select *from ac_balance where cus_id=$P{cusID} and status='UnClear']]>
</queryString>
<field name="ID" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="cus_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="sale_id" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="qty" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="payable" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="borrow" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="receiveable" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="total" class="java.lang.Integer">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="status" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="regdate" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<variable name="borrow_1" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{borrow}]]></variableExpression>
</variable>
<variable name="grandTotall" class="java.lang.Double">
<variableExpression><![CDATA[$V{borrow_1}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="52" splitType="Stretch"/>
</title>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
Images
here below some screen shots of reports properties bellow.
[Sub-report Image1][1]
[main-report Image2][2]
[output print3][3]
[image4][4]
[1]: https://i.stack.imgur.com/Gqdi4.png
[2]: https://i.stack.imgur.com/j7OoC.png
[3]: https://i.stack.imgur.com/k6LG4.png
[4]: https://i.stack.imgur.com/EQALD.png

Issue in genearting the sub report details?

I had created the report it is getting the values for first name and last name and invoice id but when I add the sub report the other values are not getting it is just printing the headings. Please solve my problem and suggest me.
It is printing as below image.
Main report code:
<?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="Usage Rport" pageWidth="595" pageHeight="842" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" >
<property name="com.jasperassistant.designer.GridHeight" value="12"/>
<property name="com.jasperassistant.designer.GridWidth" value="12"/>
<property name="com.jasperassistant.designer.SnapToGrid" value="false"/>
<property name="com.jasperassistant.designer.Grid" value="false"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<import value="org.joda.time.DateTime"/>
<parameter name="invoice_id" class="java.lang.Integer"/>
<parameter name="entity_id" class="java.lang.Integer"/>
<parameter name="entityPhoneCountryCode" class="java.lang.String"/>
<parameter name="entityPhoneAreaCode" class="java.lang.String"/>
<parameter name="entityPhoneContry" class="java.lang.String"/>
<parameter name="invoiceDate" class="java.lang.String"/>
<parameter name="invoiceDueDate" class="java.lang.String"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["D:\\Ravi Workspace\\Openbrm\\open-brm-openbrm-2.0\\descriptors\\reports\\usage\\"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select co.first_name,co.last_name,b.id as user_id from swiss_cdr_event e join order_process o join base_user b on b.id=e.user_id and e.order_id = o.order_id join contact co on e.user_id=co.user_id where o.invoice_id=$P{invoice_id} and b.entity_id=$P{entity_id} order by e.call_start_date asc;]]>
</queryString>
<field name="first_name" class="java.lang.String"/>
<field name="last_name" class="java.lang.String"/>
<field name="user_id" class="java.lang.Integer"/>
<title>
<band height="20"/>
</title>
<pageHeader>
<band height="111">
<textField>
<reportElement x="5" y="13" width="200" height="15" />
<textElement>
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{first_name}+" " +$F{last_name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="185" y="13" width="140" height="15" />
<textElement textAlignment="Left">
<font isBold="true"/>
</textElement>
<text><![CDATA[Rechnungs-Nr. ]]></text>
</staticText>
<staticText>
<reportElement x="368" y="13" width="100" height="15" />
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Jahr / Monat]]></text>
</staticText>
<staticText>
<reportElement x="379" y="28" width="52" height="15" />
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[datiert]]></text>
</staticText>
<textField>
<reportElement x="252" y="13" width="100" height="15" />
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$P{invoice_id}]]></textFieldExpression>
</textField>
<subreport>
<reportElement x="434" y="28" width="119" height="18" />
<subreportParameter name="invoiceId">
<subreportParameterExpression><![CDATA[$P{invoice_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "run-details.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="435" y="9" width="161" height="15" />
<subreportParameter name="invoiceId">
<subreportParameterExpression><![CDATA[$P{invoice_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "invoice-period-31.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement x="185" y="28" width="100" height="15" />
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Gesprächsnachweis]]></text>
</staticText>
<subreport>
<reportElement x="6" y="57" width="590" height="43" />
<subreportParameter name="invoiceId">
<subreportParameterExpression><![CDATA[$P{invoice_id}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="entityId">
<subreportParameterExpression><![CDATA[$P{entity_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "usage-31-de-details.jasper"]]></subreportExpression>
</subreport>
</band>
</pageHeader>
<pageFooter>
<band height="33">
<textField>
<reportElement x="195" y="15" width="80" height="15" />
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Seite "+$V{PAGE_NUMBER}+" von "]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="275" y="15" width="40" height="15" />
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<lastPageFooter>
<band height="33">
<textField>
<reportElement x="205" y="18" width="80" height="15" />
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Seite "+$V{PAGE_NUMBER}+" von "]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="285" y="18" width="40" height="15" />
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</lastPageFooter>
<summary>
<band height="20"/>
</summary>
Subreport code:
<?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="Usage Rport" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" >
<property name="com.jasperassistant.designer.GridHeight" value="12"/>
<property name="com.jasperassistant.designer.GridWidth" value="12"/>
<property name="com.jasperassistant.designer.SnapToGrid" value="false"/>
<property name="com.jasperassistant.designer.Grid" value="false"/>
<import value="org.joda.time.DateTime"/>
<parameter name="invoice_id" class="java.lang.Integer"/>
<parameter name="entity_id" class="java.lang.Integer"/>
<parameter name="entityCity" class="java.lang.String"/>
<parameter name="customerCity" class="java.lang.String"/>
<parameter name="entityPhoneCountryCode" class="java.lang.String"/>
<parameter name="entityPhoneAreaCode" class="java.lang.String"/>
<parameter name="entityPhoneContry" class="java.lang.String"/>
<parameter name="invoiceDate" class="java.lang.String"/>
<parameter name="invoiceDueDate" class="java.lang.String"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["D:\\Ravi Workspace\\Openbrm\\open-brm-openbrm-2.0\\descriptors\\reports\\usage\\"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select e.calling_number,e.duration,e.call_start_date,e.cost,e.destination_number,e.destination_descr,co.first_name,co.last_name,b.id as user_id from swiss_cdr_event e join order_process o join base_user b on b.id=e.user_id and e.order_id = o.order_id join contact co on e.user_id=co.user_id where o.invoice_id=$P{invoice_id} and b.entity_id=$P{entity_id} order by e.call_start_date asc;]]>
</queryString>
<field name="calling_number" class="java.lang.String"/>
<field name="destination_number" class="java.lang.String"/>
<field name="duration" class="java.lang.Integer"/>
<field name="cost" class="java.math.BigDecimal"/>
<field name="call_start_date" class="java.sql.Timestamp"/>
<field name="destination_descr" class="java.lang.String"/>
<field name="first_name" class="java.lang.String"/>
<field name="last_name" class="java.lang.String"/>
<field name="user_id" class="java.lang.Integer"/>
<variable name="total" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{cost}]]></variableExpression>
</variable>
<title>
<band height="111"/>
</title>
<columnHeader>
<band height="33">
<staticText>
<reportElement x="12" y="10" width="62" height="15" />
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Datum/Uhrzeit]]></text>
</staticText>
<staticText>
<reportElement x="240" y="10" width="85" height="15" />
<textElement>
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Destination]]></text>
</staticText>
<staticText>
<reportElement x="450" y="10" width="42" height="15" />
<textElement textAlignment="Left" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<text><![CDATA[Menge]]></text>
</staticText>
<staticText>
<reportElement x="90" y="10" width="62" height="15" />
<text><![CDATA[Anruf von]]></text>
</staticText>
<staticText>
<reportElement x="163" y="10" width="49" height="14" />
<text><![CDATA[Service]]></text>
</staticText>
<staticText>
<reportElement x="334" y="10" width="100" height="15" />
<text><![CDATA[Rufnummer]]></text>
</staticText>
<staticText>
<reportElement x="514" y="10" width="47" height="15" />
<text><![CDATA[Betrag]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20">
<textField>
<reportElement x="360" y="3" width="193" height="16" />
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[new DecimalFormat("#,##0.00").format($F{cost})]]></textFieldExpression>
</textField>
<textField>
<reportElement x="12" y="3" width="96" height="16" />
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("dd-MM-yyyy").format($F{call_start_date})]]></textFieldExpression>
</textField>
<textField>
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="242" y="3" width="121" height="16" />
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{destination_descr}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="60" y="3" width="96" height="16" />
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("HH:mm:ss").format($F{call_start_date})]]></textFieldExpression>
</textField>
<textField>
<reportElement x="450" y="4" width="100" height="16" />
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{duration}]]></textFieldExpression>
</textField>
<subreport>
<reportElement x="302" y="0" width="129" height="20" />
<subreportParameter name="invoiceId">
<subreportParameterExpression><![CDATA[$P{invoice_id}]]></subreportParameterExpression>
</subreportParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "entity-details-31.jasper"]]></subreportExpression>
</subreport>
<textField>
<reportElement x="98" y="0" width="90" height="15" />
<textFieldExpression><![CDATA[$P{entityCity}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="80">
<staticText>
<reportElement x="242" y="6" width="92" height="15" />
<text><![CDATA[Total]]></text>
</staticText>
<textField>
<reportElement x="431" y="6" width="100" height="15" />
<textElement textAlignment="Right">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{total} == null ? "0.00" : new DecimalFormat ("#,##0.00").format($V{total})]]></textFieldExpression>
</textField>
</band>
</summary>
As looking into your jrxml, You also have to pass $P{entity_id} to your sub_report. Currently you are passing only invoice id $P{invoice_id}. As your sub report sql is working on two parameter $P{invoice_id} and $P{entity_id}. if you are not passing it will pick default value or null (if no default value).
One more suggestion, sub report should contain only those band which is required and arrange your text field properly otherwise you will get excel column formating issue when you try to download in excel.
When you click on subreport and select properties then you will image like in first.
Now click on parameters in subreport tab of properties. Please see the second image.
there are three subreport in your main jrxml.
1) run-details.jrxml
Subreport parameter map in main jrxml
invoiceId : $P{invoice_id}
2) invoice-period-31.jrxml
Subreport parameter map in main jrxml
invoiceId : $P{invoice_id}
3) usage-31-de-details.jrxml
Subreport parameter map in main jrxml
invoiceId : $P{invoice_id}
I can see in 3 subreport parameter name is invoice_id. So you should change to
Subreport parameter map in main jrxml
invoice_id : $P{invoice_id}
And Also 3 sub report is working on entity_id parameter. you also have to pass that value.
Now
Subreport parameter map in main jrxml
invoice_id : $P{invoice_id}
entity_id : $P{entity_id}
I am not sure what parameter name is used in another subreport.

How to create a jasper report that manage overflow in next page?

i would like to know if is possible have a report that has a lot of fields that manage automatically the overflow in other page. I would put every field in detail tag and i would like that when there is some element that goes outside of detail area, it could be appear in the next one. Below i posted my jasper report:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.0.0.final using JasperReports Library version 6.0.0 -->
<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="SvamaTemplate" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="335f8e22-f47d-4b34-abcd-a6682c0cf7b4">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="SvamaTemplateXML"/>
<queryString language="xPath">
<![CDATA[/]]>
</queryString>
<field name="id" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/#id]]></fieldDescription>
</field>
<field name="potenziale_residuo_vpot" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="potenziale_residuo_vpot"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="supporto_rete_sociale" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="supporto_rete_sociale"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="pulizia_casa" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="pulizia_casa"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="lavanderia" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="lavanderia"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="effettuazione_acquisti" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="effettuazione_acquisti"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="bagno" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="bagno"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="toiletta" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="toiletta"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="abbigliamento1" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="abbigliamento1"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="uso_wc" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="uso_wc"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="assuzione_medicinali" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="assuzione_medicinali"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="trasferimenti" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="trasferimenti"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="deambulazione1" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="deambulazione1"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="gestione_denaro" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="gestione_denaro"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="sostegno_psicoaffettivo" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="sostegno_psicoaffettivo"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="supervisione_diurna" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="supervisione_diurna"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<field name="supervisione_notturna" class="java.lang.String">
<fieldDescription><![CDATA[/svama/sections/section/subsection/selectOneRadio[#id="supervisione_notturna"]/items/item[#selected="true"]/value/text()]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="47" splitType="Stretch">
<staticText>
<reportElement x="230" y="8" width="100" height="30" uuid="91c6fde2-503f-4228-8cf0-e2878b9fdb3b"/>
<textElement textAlignment="Center">
<font size="20" isBold="true"/>
</textElement>
<text><![CDATA[SVAMA]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="13" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="13" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="270" splitType="Stretch">
<textField>
<reportElement x="130" y="120" width="424" height="30" uuid="74e0b517-f4c9-4679-a8d2-54e7f4582a3e"/>
<textFieldExpression><![CDATA[$F{pulizia_casa}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="120" width="110" height="30" uuid="40f82bd5-9d95-45b3-b21d-c7f738c576c5"/>
<text><![CDATA[pulizia_casa]]></text>
</staticText>
<textField>
<reportElement x="130" y="200" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{effettuazione_acquisti}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="200" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[effettuazione_acquisti]]></text>
</staticText>
<!-- break is attempt, i don't know what should put here -->
<break>
<reportElement x="0" y="270" width="517" height="1" uuid="08ff5b1a-7ff4-4848-ba95-e9ce31d0d44e"/>
</break>
<staticText>
<reportElement x="10" y="280" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[toiletta]]></text>
</staticText>
<textField>
<reportElement x="130" y="280" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{toiletta}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="320" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[abbigliamento1]]></text>
</staticText>
<textField>
<reportElement x="130" y="320" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{abbigliamento1}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="360" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[uso_wc]]></text>
</staticText>
<textField>
<reportElement x="130" y="360" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{uso_wc}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="440" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[trasferimenti]]></text>
</staticText>
<textField>
<reportElement x="130" y="440" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{trasferimenti}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="520" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[gestione_denaro]]></text>
</staticText>
<textField>
<reportElement x="130" y="520" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{gestione_denaro}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="560" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[sostegno_psicoaffettivo]]></text>
</staticText>
<textField>
<reportElement x="130" y="560" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{sostegno_psicoaffettivo}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="10" y="640" width="110" height="30" uuid="e2d4b4b2-5c98-4041-9b94-36aa7e2c53e5"/>
<text><![CDATA[supervisione_notturna]]></text>
</staticText>
<textField>
<reportElement x="130" y="640" width="424" height="30" uuid="f8c91c60-26bb-419e-87a7-8b2dd158b83b"/>
<textFieldExpression><![CDATA[$F{supervisione_notturna}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
Does anyone have any idea? Thanks in advance.
Try changing:
<detail>
<band height="270" splitType="Stretch">
to
<detail>
<band height="270" splitType="Immediate">
In case it starts printing a blank page at the end, you might want to use:
<detail>
<band height="270" splitType="Prevent">
Instead

Show subreport independent of master datasource (master report) in ireport

Well, i have a Master and a SubReport where in master report i have 2 detail bands. In first detail band i put the "main datasource" (from fillReport), and in detail band 2 i put the subreport (datasource from a param).
My master report is configured to display "All Sections, No Detail" but the problem is that when "main datasource" dont have records the subreport isn't showed. I need show subreport detail independent of content of "main datasource".
How can i do it?
This is my report XML:
<?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="rf002" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="575" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" uuid="4436a245-e7f4-426f-aabc-806179a89e8a">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="84"/>
<parameter name="pathSubreport" class="java.lang.String">
<defaultValueExpression><![CDATA["/home/ronaldo/workspace/sender/src/main/webapp/WEB-INF/report/"]]></defaultValueExpression>
</parameter>
<parameter name="titulo" class="java.lang.String"/>
<parameter name="endereco" class="java.lang.String"/>
<parameter name="cep" class="java.lang.String"/>
<parameter name="estado" class="java.lang.String"/>
<parameter name="cidade" class="java.lang.String"/>
<parameter name="razaoSocial" class="java.lang.String"/>
<parameter name="pathLogomarca" class="java.lang.String"/>
<parameter name="usuario" class="java.lang.String"/>
<parameter name="dataFechamento" class="java.util.Date"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["/home/ronaldo/workspace/odontonew/src/main/webapp/WEB-INF/report/"]]></defaultValueExpression>
</parameter>
<parameter name="totaltt" class="java.lang.Double"/>
<parameter name="dentista" class="br.com.odontonew.bean.Dentista"/>
<parameter name="historicosCaixaDentista" class="java.lang.Object"/>
<parameter name="historicosPagamentoOrcamento" class="java.lang.Object"/>
<parameter name="parcelasAVencerHoje" class="java.lang.Object"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="nomePaciente" class="java.lang.String">
<fieldDescription><![CDATA[orcamento.paciente.pessoaFisica.nome]]></fieldDescription>
</field>
<field name="dataHoraConsulta" class="java.sql.Timestamp">
<fieldDescription><![CDATA[dataHoraAgendada]]></fieldDescription>
</field>
<field name="idConsulta" class="java.lang.Integer">
<fieldDescription><![CDATA[id]]></fieldDescription>
</field>
<field name="nomeProcedimento" class="java.lang.String">
<fieldDescription><![CDATA[itens.itemTabelaProcedimento.procedimento.nome]]></fieldDescription>
</field>
<field name="isConcluido" class="java.lang.Boolean">
<fieldDescription><![CDATA[itens.concluido]]></fieldDescription>
</field>
<group name="consulta">
<groupExpression><![CDATA[$F{idConsulta}]]></groupExpression>
<groupHeader>
<band height="33">
<textField isBlankWhenNull="true">
<reportElement x="8" y="16" width="276" height="14" uuid="fd8d4206-2b32-4619-a340-95b4357b6a1a"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{nomePaciente}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true">
<reportElement x="292" y="16" width="184" height="14" uuid="e7b1cb6b-c4c4-42ab-b028-69e720f43f1f"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataHoraConsulta}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="9" y="5" width="149" height="12" uuid="bf06788d-c15a-4547-8a6e-df2ae3be70ea"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Paciente da Consulta]]></text>
</staticText>
<staticText>
<reportElement x="292" y="5" width="149" height="12" uuid="4d788cff-e015-4085-a320-8924a6a6b48c"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[Data e Hora da Consulta]]></text>
</staticText>
</band>
</groupHeader>
</group>
<background>
<band/>
</background>
<title>
<band height="90" splitType="Stretch">
<subreport>
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="575" height="90" uuid="0999674d-9841-41dd-97c2-226b2186b45e"/>
<subreportParameter name="pathLogomarca">
<subreportParameterExpression><![CDATA[$P{pathLogomarca}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="cidade">
<subreportParameterExpression><![CDATA[$P{cidade}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="titulo">
<subreportParameterExpression><![CDATA[$P{titulo}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="cep">
<subreportParameterExpression><![CDATA[$P{cep}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="estado">
<subreportParameterExpression><![CDATA[$P{estado}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="usuario">
<subreportParameterExpression><![CDATA[$P{usuario}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="razaoSocial">
<subreportParameterExpression><![CDATA[$P{razaoSocial}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="endereco">
<subreportParameterExpression><![CDATA[$P{endereco}]]></subreportParameterExpression>
</subreportParameter>
<subreportExpression><![CDATA[$P{pathSubreport}+"headerTemplate.jasper"]]></subreportExpression>
</subreport>
</band>
</title>
<columnHeader>
<band height="76">
<rectangle>
<reportElement x="0" y="27" width="575" height="49" backcolor="#DFDCDC" uuid="4e1f0879-74cc-46bf-8fb2-bb60ea002018"/>
<graphicElement>
<pen lineWidth="0.0"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="416" y="57" width="140" height="14" uuid="afd4b28f-8b51-43d1-a9a2-c4acbb1f6c63"/>
<textElement textAlignment="Center">
<font isBold="true"/>
</textElement>
<text><![CDATA[Concluído]]></text>
</staticText>
<staticText>
<reportElement x="7" y="57" width="397" height="14" uuid="2c8deaa8-9d46-4c31-a542-e41b7f959615"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Procedimento]]></text>
</staticText>
<staticText>
<reportElement x="9" y="34" width="397" height="14" uuid="6578bf15-8e39-4a0d-9fc6-5c45fb5ad566"/>
<textElement>
<font isBold="true" isItalic="true" isUnderline="false"/>
</textElement>
<text><![CDATA[Consultas Realizadas]]></text>
</staticText>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="120" y="5" width="165" height="14" uuid="4a835664-78da-4231-b7de-a21b730b4a7e"/>
<textFieldExpression><![CDATA[$P{dataFechamento}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="6" y="5" width="112" height="14" uuid="8420da3e-43c6-49a6-a688-89d50b5095a7"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Data Fechamento:]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21">
<textField isBlankWhenNull="true">
<reportElement x="10" y="4" width="394" height="14" uuid="0f1109a2-30d7-4789-bb6f-54d066856cf3"/>
<textFieldExpression><![CDATA[$F{nomeProcedimento}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="425" y="1" width="131" height="14" uuid="6b67a6ee-6732-48b6-b79e-12f6e371c35e"/>
<textFieldExpression><![CDATA[$F{isConcluido} ? "Sim" : "Não"]]></textFieldExpression>
</textField>
</band>
<band height="173">
<subreport>
<reportElement x="0" y="0" width="575" height="73" uuid="871e12c8-2633-4d76-8d65-ce253710c4eb"/>
<dataSourceExpression><![CDATA[$P{historicosPagamentoOrcamento}]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "rf002_historicosPagamentoOrcamento.jasper"]]></subreportExpression>
</subreport>
<subreport>
<reportElement x="0" y="94" width="575" height="69" uuid="338fd0af-a2ca-453e-8777-0f49698ebb44"/>
<dataSourceExpression><![CDATA[$P{historicosCaixaDentista}]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "rf002_historicosCaixa.jasper"]]></subreportExpression>
</subreport>
</band>
</detail>
<lastPageFooter>
<band height="185" splitType="Stretch">
<textField evaluationTime="Report">
<reportElement x="516" y="155" width="40" height="20" uuid="3cd272a2-adde-48f0-9f1e-5d7f007b9a1f"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="436" y="155" width="80" height="20" uuid="7cc86ec7-b620-4c95-9147-1410b1a22054"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
</band>
</lastPageFooter>
</jasperReport>
SOLUTION
After a lot of research i saw that my concept about "main report" and "subreport" is wrong. When we have a "main report" (associated with a main datasource) the correct is that all "subreport" is directly associated with this. So, i created 3 subreports and pass all datasources like a 'param'. In JasperManagerFillReport i passed a "JREmptyDataSource" to avoid the blank page because "main datasource" don't have any content.
You can try setting WhenNoData property to NoDataSection. Then, in the No Data band add what you want.
Also, check what happens to the subreports when the parameters you send as dataSourceExpression are empty (if they are).

Report designing issue using iReport

I am designing an invoice using iReport but i am having a problem with formatting.
I have to print invoice on letter head, where there are fixed positions to print the fields for example the total Amount has to get printed inside the box fixed at some location.
This is format of letter head:
At the bottom there is a field where total amount has to get printed, but i am not able to do so.
My output using iReport:
Screen Shot of iReport
This is my jrxml file:
<?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="LetterHeadInvoice" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<parameter name="COMPANY_ADDRESS" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="COMPANY_NAME" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="INVOICENO" class="java.lang.String">
<defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[SELECT DISTINCT c.docketno,c.bookingdate,c.rname,c.rcity,c.rcountry
,c.noofitems,c.actualweight,c.volweight,p.docketcharges,p.weight as weightused,
p.total,i.type,c.sname,c.scity,c.scountry,c.bookingdate,s.fovtype ,s.fovamount,s.oditype ,s.odiamount,s.nformtype ,s.nformamount,o.fsetype,o.fseamount
FROM typedetails i,paymentdetails p,clientdetails c,subdetails s,otherdetails o
WHERE i.id=c.typeid
AND c.docketno=p.docketno
And c.docketno= s.docketno
And c.docketno= o.docketno
AND c.docketno IN (SELECT docketnumber FROM invoice WHERE InvoiceId=$P{INVOICENO})]]>
</queryString>
<field name="docketno" class="java.lang.String"/>
<field name="bookingdate" class="java.sql.Timestamp"/>
<field name="rname" class="java.lang.String"/>
<field name="rcity" class="java.lang.String"/>
<field name="rcountry" class="java.lang.String"/>
<field name="noofitems" class="java.lang.Integer"/>
<field name="actualweight" class="java.math.BigDecimal"/>
<field name="volweight" class="java.lang.Short"/>
<field name="docketcharges" class="java.lang.Integer"/>
<field name="weightused" class="java.lang.Integer"/>
<field name="total" class="java.lang.Integer"/>
<field name="type" class="java.lang.String"/>
<field name="sname" class="java.lang.String"/>
<field name="scity" class="java.lang.String"/>
<field name="scountry" class="java.lang.String"/>
<field name="fovtype" class="java.lang.String"/>
<field name="fovamount" class="java.lang.String"/>
<field name="oditype" class="java.lang.String"/>
<field name="odiamount" class="java.lang.String"/>
<field name="nformtype" class="java.lang.String"/>
<field name="nformamount" class="java.lang.String"/>
<field name="fsetype" class="java.lang.String"/>
<field name="fseamount" class="java.lang.Integer"/>
<variable name="TOTAL" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[$F{total}]]></variableExpression>
</variable>
<variable name="TOTAL2" class="java.lang.Double" incrementType="Column" calculation="Sum">
<variableExpression><![CDATA[$V{TOTAL}+$F{fseamount}]]></variableExpression>
</variable>
<variable name="Tax" class="java.lang.Double">
<variableExpression><![CDATA[$V{TOTAL2}/100.00*12.36]]></variableExpression>
</variable>
<background>
<band height="802" splitType="Stretch">
<image>
<reportElement x="0" y="0" width="555" height="802"/>
<imageExpression><![CDATA["C:\\Documents and Settings\\Hemant\\Desktop\\RNZImage.jpg"]]></imageExpression>
</image>
</band>
</background>
<title>
<band height="205" splitType="Stretch">
<staticText>
<reportElement x="40" y="61" width="40" height="23"/>
<textElement>
<font fontName="Lucida Bright" size="12" isBold="true"/>
</textElement>
<text><![CDATA[Bill To]]></text>
</staticText>
<textField>
<reportElement x="40" y="84" width="266" height="107"/>
<textElement>
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$F{sname}+"\n"+$F{scity}+","+$F{scountry}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="324" y="95" width="91" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{INVOICENO}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="429" y="96" width="104" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField pattern="MMMMM-yy">
<reportElement x="312" y="145" width="83" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</title>
<detail>
<band height="112" splitType="Stretch">
<textField pattern="MM/dd/yyyy">
<reportElement x="28" y="31" width="52" height="20"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{bookingdate}.toString().substring(0,$F{bookingdate}.toString().indexOf(" "))]]></textFieldExpression>
</textField>
<textField>
<reportElement x="82" y="31" width="54" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{docketno}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="164" y="31" width="77" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{rcity}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="261" y="31" width="35" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{rcity}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="306" y="31" width="33" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{noofitems}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="345" y="31" width="33" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{weightused}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="395" y="31" width="73" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{type}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="480" y="31" width="48" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{docketcharges}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="346" y="90" width="123" height="17" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{oditype}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="480" y="90" width="55" height="17" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{odiamount}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="346" y="56" width="123" height="17" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{fovtype}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="480" y="73" width="55" height="17" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{nformamount}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="346" y="73" width="123" height="17" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{nformtype}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="480" y="56" width="55" height="17" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{fovamount}]]></textFieldExpression>
</textField>
</band>
</detail>
<summary>
<band height="280" splitType="Stretch">
<textField>
<reportElement x="478" y="12" width="59" height="20"/>
<textElement markup="none"/>
<textFieldExpression><![CDATA[$V{TOTAL}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="334" y="32" width="128" height="17">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{fsetype}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="478" y="32" width="59" height="17">
<printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
</reportElement>
<textElement/>
<textFieldExpression><![CDATA[$F{fseamount}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="334" y="49" width="128" height="20"/>
<textElement/>
<text><![CDATA[TOTAL]]></text>
</staticText>
<staticText>
<reportElement x="334" y="12" width="128" height="20"/>
<textElement/>
<text><![CDATA[SUB TOTAL]]></text>
</staticText>
<textField pattern="###0.00">
<reportElement x="478" y="69" width="59" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{TOTAL2}/100.00*12.36]]></textFieldExpression>
</textField>
<textField>
<reportElement x="478" y="49" width="59" height="20"/>
<textElement markup="none"/>
<textFieldExpression><![CDATA[$V{TOTAL}+$F{fseamount}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="334" y="69" width="128" height="20"/>
<textElement/>
<text><![CDATA[Service Tax At 12.36%]]></text>
</staticText>
<textField pattern="###0.00">
<reportElement x="464" y="252" width="73" height="20"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{TOTAL2}+$V{Tax}]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>
You should try to change Position Type to Fix Relative to Bottom or Float for this textField (with $V{TOTAL2}+$V{Tax} expression).
<textField pattern="###0.00">
<reportElement positionType="FixRelativeToBottom" x="464" y="252" width="73" height="20"/>
<textElement>
<font size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{TOTAL2}+$V{Tax}]]></textFieldExpression>
</textField>