Avoid Repeating Column Header in Table - jasper-reports

I am a newbie to JasperReports. When I try to add values to table in the columns the column header and footer are getting repeated. How should I group column header.
My jrxml:
<?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="report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="551344a1-61b0-419c-92a0-5ebe6f8d4219">
<property name="ireport.zoom" value="1.2100000000000004"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 2_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Table Dataset 1" uuid="75c6059a-1e76-45b2-a87c-14792e68956e">
<field name="training" class="java.lang.String"/>
<field name="trainingPeriod" class="java.lang.String"/>
<field name="traingingAdd" class="java.lang.String"/>
<field name="noofgovtorderauth" class="java.lang.String"/>
<field name="authapprovingentry" class="java.lang.String"/>
<field name="deptTestpassed" class="java.lang.String"/>
<field name="athConducTest" class="java.lang.String"/>
<field name="monthSptestPassed" class="java.lang.String"/>
<field name="yrSpTestPassed" class="java.lang.String"/>
<field name="regNo" class="java.lang.String"/>
</subDataset>
<parameter name="ReportName" class="java.lang.String"/>
<parameter name="Date" class="java.lang.String"/>
<parameter name="Title" class="java.lang.String"/>
<parameter name="SubTitle" class="java.lang.String"/>
<parameter name="FooterDetail" class="java.lang.String"/>
<parameter name="govtlogo" class="java.lang.String"/>
<parameter name="TNWRDLogo" class="java.lang.String"/>
<field name="training" class="java.lang.String">
<fieldDescription><![CDATA[training]]></fieldDescription>
</field>
<field name="trainingPeriod" class="java.lang.String"/>
<field name="traingingAdd" class="java.lang.String"/>
<field name="noofgovtorderauth" class="java.lang.String"/>
<field name="authapprovingentry" class="java.lang.String"/>
<field name="deptTestpassed" class="java.lang.String"/>
<field name="athConducTest" class="java.lang.String"/>
<field name="monthSptestPassed" class="java.lang.String"/>
<field name="yrSpTestPassed" class="java.lang.String"/>
<field name="regNo" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch">
<frame>
<reportElement uuid="fd5eaed7-88e8-4980-8205-6e50cf99ef20" x="0" y="27" width="565" height="52">
<property name="net.sf.jasperreports.export.pdf.tag.h1"/>
<property name="net.sf.jasperreports.export.pdf.tag.tr" value="full"/>
<property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
<property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
</reportElement>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
<textField>
<reportElement uuid="d3615141-0461-4665-b5f4-46a10f968d0e" x="174" y="33" width="213" height="19"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{SubTitle}]]></textFieldExpression>
</textField>
<image>
<reportElement uuid="34b5159e-3eb2-450a-9536-f79813589d48" x="442" y="2" width="61" height="48"/>
<imageExpression><![CDATA[$P{TNWRDLogo}]]></imageExpression>
</image>
<image>
<reportElement uuid="cd0f7d86-105f-44a1-8c27-81feacfba469" x="65" y="0" width="98" height="51"/>
<imageExpression><![CDATA[$P{govtlogo}]]></imageExpression>
</image>
<textField>
<reportElement uuid="e8aee322-2336-4637-9a5c-cb51af5995c8" x="174" y="0" width="213" height="32"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{Title}]]></textFieldExpression>
</textField>
</frame>
</band>
</title>
<pageHeader>
<band height="35" splitType="Stretch">
<textField>
<reportElement uuid="4c89127c-2b66-447e-af83-7ffd210e8a19" x="174" y="5" width="213" height="24"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{ReportName}]]></textFieldExpression>
</textField>
<frame>
<reportElement uuid="4ba70858-74c9-48a0-9690-888636570607" x="0" y="0" width="565" height="35"/>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
</frame>
</band>
</pageHeader>
<columnHeader>
<band height="23" splitType="Stretch">
<staticText>
<reportElement uuid="479cad61-a5be-4318-8e81-850ba6626e59" x="27" y="0" width="100" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Training Detail]]></text>
</staticText>
<staticText>
<reportElement uuid="d3474389-b724-4579-81b6-2f5c806aaa25" x="432" y="0" width="100" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Special Tests Passed]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<componentElement>
<reportElement uuid="f2abf631-2415-4ba1-bf93-4b1d458dacbc" key="table 2" style="table 2" x="53" y="44" width="450" height="50"/>
<jr:table 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="Table Dataset 1" uuid="69dfdbc6-34fc-48ee-8ecd-197cde9b11fb">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
</datasetRun>
<jr:columnGroup width="450" uuid="7287994d-bc5c-4286-8607-29969a2eb9ef">
<jr:column width="90" uuid="dbd24c78-fb82-47c4-9342-d5a73fb7e000">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="74b27263-d281-4136-b674-12bd3a74bd3c" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Training]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="be34b5c1-5cd4-43e3-b6f9-0e6f2bbf88db" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{training}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="01a9c90b-46c3-4693-b186-7abc77256f73">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="5ada3627-2084-4d79-a923-b6acbeee8058" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Period / Duration]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="abb64036-38ea-4560-84fd-09dde730c3bc" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{trainingPeriod}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="0865e4a3-5dbe-430a-9c50-90a636ef49ef">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="a897110e-f09f-43f3-a53b-aa8450065832" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Impart Training Address]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="41f45483-1f6d-480c-a59c-96093111ace5" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{traingingAdd}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="8949efe8-7041-49dd-8631-685e8568e6d5">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="643bb124-0b66-448d-ade8-c7b540f18eb5" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[No of Government Orders]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="834227d7-673a-4335-b1f8-37b3892125b1" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{noofgovtorderauth}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="7fa15b45-3110-4648-ab41-35fc77c625d6">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="cfd20c24-75f4-449e-83ae-38d9e0507728" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[ Approving Audthority]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="b5e5dec0-46d3-47b5-aefe-5fe2038c94b9" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{authapprovingentry}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:columnGroup>
</jr:table>
</componentElement>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>

Try this , It will work for you.
<?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="report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="551344a1-61b0-419c-92a0-5ebe6f8d4219">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 2_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Table Dataset 1" uuid="75c6059a-1e76-45b2-a87c-14792e68956e">
<field name="training" class="java.lang.String"/>
<field name="trainingPeriod" class="java.lang.String"/>
<field name="traingingAdd" class="java.lang.String"/>
<field name="noofgovtorderauth" class="java.lang.String"/>
<field name="authapprovingentry" class="java.lang.String"/>
<field name="deptTestpassed" class="java.lang.String"/>
<field name="athConducTest" class="java.lang.String"/>
<field name="monthSptestPassed" class="java.lang.String"/>
<field name="yrSpTestPassed" class="java.lang.String"/>
<field name="regNo" class="java.lang.String"/>
</subDataset>
<parameter name="ReportName" class="java.lang.String"/>
<parameter name="Date" class="java.lang.String"/>
<parameter name="Title" class="java.lang.String"/>
<parameter name="SubTitle" class="java.lang.String"/>
<parameter name="FooterDetail" class="java.lang.String"/>
<parameter name="govtlogo" class="java.lang.String"/>
<parameter name="TNWRDLogo" class="java.lang.String"/>
<field name="training" class="java.lang.String">
<fieldDescription><![CDATA[training]]></fieldDescription>
</field>
<field name="trainingPeriod" class="java.lang.String"/>
<field name="traingingAdd" class="java.lang.String"/>
<field name="noofgovtorderauth" class="java.lang.String"/>
<field name="authapprovingentry" class="java.lang.String"/>
<field name="deptTestpassed" class="java.lang.String"/>
<field name="athConducTest" class="java.lang.String"/>
<field name="monthSptestPassed" class="java.lang.String"/>
<field name="yrSpTestPassed" class="java.lang.String"/>
<field name="regNo" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="114" splitType="Stretch">
<frame>
<reportElement uuid="fd5eaed7-88e8-4980-8205-6e50cf99ef20" x="0" y="27" width="565" height="52">
<property name="net.sf.jasperreports.export.pdf.tag.h1"/>
<property name="net.sf.jasperreports.export.pdf.tag.tr" value="full"/>
<property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
<property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
</reportElement>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
<textField>
<reportElement uuid="d3615141-0461-4665-b5f4-46a10f968d0e" x="174" y="33" width="213" height="19"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{SubTitle}]]></textFieldExpression>
</textField>
<image>
<reportElement uuid="34b5159e-3eb2-450a-9536-f79813589d48" x="442" y="2" width="61" height="48"/>
<imageExpression><![CDATA[$P{TNWRDLogo}]]></imageExpression>
</image>
<image>
<reportElement uuid="cd0f7d86-105f-44a1-8c27-81feacfba469" x="65" y="0" width="98" height="51"/>
<imageExpression><![CDATA[$P{govtlogo}]]></imageExpression>
</image>
<textField>
<reportElement uuid="e8aee322-2336-4637-9a5c-cb51af5995c8" x="174" y="0" width="213" height="32"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{Title}]]></textFieldExpression>
</textField>
</frame>
</band>
</title>
<pageHeader>
<band height="35" splitType="Stretch">
<textField>
<reportElement uuid="4c89127c-2b66-447e-af83-7ffd210e8a19" x="174" y="5" width="213" height="24"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{ReportName}]]></textFieldExpression>
</textField>
<frame>
<reportElement uuid="4ba70858-74c9-48a0-9690-888636570607" x="0" y="0" width="565" height="35"/>
<box>
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
<leftPen lineWidth="0.25"/>
<bottomPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
</frame>
</band>
</pageHeader>
<columnHeader>
<band height="23" splitType="Stretch">
<printWhenExpression><![CDATA[$V{REPORT_COUNT} == 1]]></printWhenExpression>
<staticText>
<reportElement uuid="479cad61-a5be-4318-8e81-850ba6626e59" x="27" y="0" width="100" height="22">
<printWhenExpression><![CDATA[$V{REPORT_COUNT} == 1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Training Detail]]></text>
</staticText>
<staticText>
<reportElement uuid="d3474389-b724-4579-81b6-2f5c806aaa25" x="432" y="0" width="100" height="22">
<printWhenExpression><![CDATA[$V{REPORT_COUNT} == 1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Special Tests Passed]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<componentElement>
<reportElement uuid="f2abf631-2415-4ba1-bf93-4b1d458dacbc" key="table 2" style="table 2" x="53" y="44" width="450" height="50"/>
<jr:table 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="Table Dataset 1" uuid="69dfdbc6-34fc-48ee-8ecd-197cde9b11fb">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
</datasetRun>
<jr:columnGroup uuid="7287994d-bc5c-4286-8607-29969a2eb9ef" width="450">
<jr:column uuid="dbd24c78-fb82-47c4-9342-d5a73fb7e000" width="90">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="74b27263-d281-4136-b674-12bd3a74bd3c" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Training]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="be34b5c1-5cd4-43e3-b6f9-0e6f2bbf88db" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{training}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="01a9c90b-46c3-4693-b186-7abc77256f73" width="90">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="5ada3627-2084-4d79-a923-b6acbeee8058" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Period / Duration]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="abb64036-38ea-4560-84fd-09dde730c3bc" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{trainingPeriod}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="0865e4a3-5dbe-430a-9c50-90a636ef49ef" width="90">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="a897110e-f09f-43f3-a53b-aa8450065832" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[Impart Training Address]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="41f45483-1f6d-480c-a59c-96093111ace5" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{traingingAdd}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="8949efe8-7041-49dd-8631-685e8568e6d5" width="90">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="643bb124-0b66-448d-ade8-c7b540f18eb5" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[No of Government Orders]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="834227d7-673a-4335-b1f8-37b3892125b1" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{noofgovtorderauth}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column uuid="7fa15b45-3110-4648-ab41-35fc77c625d6" width="90">
<jr:columnHeader style="table 2_CH" height="29" rowSpan="1">
<staticText>
<reportElement uuid="cfd20c24-75f4-449e-83ae-38d9e0507728" x="0" y="0" width="90" height="29"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<text><![CDATA[ Approving Audthority]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 2_TD" height="30" rowSpan="1">
<textField>
<reportElement uuid="b5e5dec0-46d3-47b5-aefe-5fe2038c94b9" x="0" y="0" width="90" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{authapprovingentry}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:columnGroup>
</jr:table>
</componentElement>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
Enjoy....

Related

Set font does not affect the appearance of cells in output excel file

I try to give Persian text and numbers in xlsx. I want the numbers to be displayed in Arabic and Persian
As you can see, Persian font is applied and the numbers are in Persian but not so in xlsx
As you see font set but not applied On the other hand, the "B Farnaz" font is installed in the Windows operating system
<?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="rptReport"
pageWidth="842"
pageHeight="595"
orientation="Landscape"
columnWidth="802"
leftMargin="20"
rightMargin="20"
topMargin="20"
bottomMargin="20"
whenNoDataType="AllSectionsNoDetail">
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.1" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.2" value="pageFooter"/>
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.3" value="title"/>
<property name="net.sf.jasperreports.crosstab.ignore.width" value="true"/>
<style name="textStyle" hTextAlign="Center" vTextAlign="Middle" fontName="B Farnaz" fontSize="10" pdfFontName= "C:/fonts/nazanin.ttf" pdfEncoding="Identity-H"/>
<parameter name="reportName" class="java.lang.String"/>
<parameter name="currentDate" class="java.lang.String"/>
<parameter name="number" class="java.lang.String"/>
<parameter name="pageName" class="java.lang.String"/>
<parameter name="ofName" class="java.lang.String"/>
<parameter name="logo" class="java.io.InputStream"/>
<field name="count" class="java.lang.Integer"/>
<field name="organizationId" class="java.lang.String"/>
<field name="orgName" class="java.lang.String"/>
<field name="orgCode" class="java.lang.String"/>
<field name="orgTypeName" class="java.lang.String"/>
<field name="positionId" class="java.lang.String"/>
<field name="title" class="java.lang.String"/>
<field name="orgParentName" class="java.lang.String"/>
<title>
<band height="61">
<rectangle>
<reportElement x="0" y="0" width="802" height="60" uuid="e0e43037-9be9-410e-9e49-9f03a811629b"/>
<graphicElement>
<pen lineWidth="0.75"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="70" y="13" width="40" height="20" uuid="80c01bc2-7498-4a53-9183-9716832fa86e"/>
<textElement textAlignment="Left">
<font fontName="B Farnaz" size="14" pdfFontName= "C:/Users/m.shadkam/Desktop/PORTAL/portal-server/src/main/resources/report/fonts/nazanin.ttf" pdfEncoding="Identity-H"/>
</textElement>
<text><![CDATA[تاريخ :]]></text>
</staticText>
<staticText>
<reportElement x="70" y="35" width="40" height="20" uuid="df222e3e-0a63-4cff-8b4a-7b7d6cdad5b2"/>
<textElement textAlignment="Left">
<font fontName="B Farnaz" size="14" pdfFontName= "C:/Users/m.shadkam/Desktop/PORTAL/portal-server/src/main/resources/report/fonts/nazanin.ttf" pdfEncoding="Identity-H"/>
</textElement>
<text><![CDATA[شماره :]]></text>
</staticText>
<image hAlign="Right">
<reportElement x="690" y="13" width="110" height="44" uuid="6b166494-6df6-4472-8140-da4f93644616"/>
<imageExpression><![CDATA[$P{logo}]]></imageExpression>
</image>
<textField>
<reportElement x="3" y="35" width="65" height="20" uuid="52b5428c-f329-4d65-be61-51e529269ca7"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="B Farnaz" pdfFontName= "C:/fonts/BNAZANIN.TTF" pdfEncoding="Identity-H"/>
</textElement>
<textFieldExpression><![CDATA[$P{number}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="0" y="1" width="802" height="35" uuid="c9904a66-50ba-4cee-9fa9-b6b29feec8b0"/>
<textElement textAlignment="Center" verticalAlignment="Top">
<font fontName="B Farnaz" size="14" pdfFontName= "C:/fonts/titr.ttf" pdfEncoding="Identity-H"/>
</textElement>
<textFieldExpression><![CDATA[$P{reportName}]]></textFieldExpression>
</textField>
<textField pattern="">
<reportElement x="3" y="13" width="65" height="20" uuid="fdc85694-ba29-4858-915e-23399415a806"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="B Farnaz" pdfFontName= "C:/fonts/BNAZANIN.TTF" pdfEncoding="Identity-H"/>
</textElement>
<textFieldExpression><![CDATA[$P{currentDate}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="20">
<textField>
<reportElement x="739" y="0" width="63" height="20" />
<textElement textAlignment="Right">
<font fontName="B Farnaz" pdfFontName="C:/fonts/BNAZANIN.TTF" pdfEncoding="Identity-H"/>
</textElement>
<textFieldExpression><![CDATA[$P{pageName} + " " + $V{PAGE_NUMBER} + " " + $P{ofName} +" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<pageFooter>
<band height="23" splitType="Stretch">
<textField>
<reportElement x="0" y="2" width="802" height="20" uuid="b8f61bae-86d8-4a73-8c23-3484b431a65e"/>
<textElement textAlignment="Center">
<font fontName="B Farnaz" pdfFontName= "C:/fonts/BNAZANIN.TTF" pdfEncoding="Identity-H"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height = "79">
<crosstab ignoreWidth="true">
<reportElement x="0" y="0" height="79" width="500"/>
<crosstabHeaderCell>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="100" y="0" width="100" height="100" />
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textFieldExpression><![CDATA["اداره امور"]]></textFieldExpression>
</textField>
<textField>
<reportElement style="textStyle" x="0" y="0" width="100" height="100" />
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textFieldExpression><![CDATA["واحد/کادر"]]></textFieldExpression>
</textField>
</cellContents>
</crosstabHeaderCell>
<rowGroup name="orgName" width="100" totalPosition="End">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{orgName}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="100" height="25" uuid="722e2c03-df3c-4012-aecf-91b7a8bad18d"/>
<textFieldExpression><![CDATA[$V{orgName}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement style="textStyle" x="0" y="0" width="200" height="25" uuid="4e9afca3-c0a3-4182-b3ce-9afb39fd3468"/>
<text><![CDATA[کل]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="orgParentName" width="100" totalPosition="End">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{orgParentName}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="100" height="25" uuid="63804c09-f3f6-401f-8598-fa2e35860a8f"/>
<textFieldExpression><![CDATA[$V{orgParentName}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="title" height="100" totalPosition="End">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{title}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="25" height="100" uuid="7edd05fd-4252-404d-bb82-54a705040663"/>
<textElement rotation="Left"/>
<textFieldExpression><![CDATA[$V{title}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement style="textStyle" x="0" y="0" width="25" height="100" uuid="de037370-9595-4ab0-8d55-ec94159f9ca0"/>
<textElement rotation="Left"/>
<text><![CDATA[کل]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="countMeasure" class="java.lang.Integer" calculation="Sum">
<measureExpression><![CDATA[$F{count}]]></measureExpression>
</measure>
<crosstabCell width="25" height="25">
<cellContents>
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="25" height="25" uuid="2de587ed-74f0-46c2-8425-5a4e9bd120e6"/>
<textFieldExpression><![CDATA[$V{countMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="25" rowTotalGroup="orgName">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="25" height="25" uuid="e7dd4c40-847f-4df0-b910-f99566746ecb"/>
<textFieldExpression><![CDATA[$V{countMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="25" columnTotalGroup="title">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="25" height="25" uuid="2ed6a617-5440-4bee-931e-dc4e16f0539d"/>
<textFieldExpression><![CDATA[$V{countMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="orgName" columnTotalGroup="title">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="textStyle" x="0" y="0" width="25" height="25"/>
<textFieldExpression><![CDATA[$V{countMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="0" rowTotalGroup="orgParentName">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
</cellContents>
</crosstabCell>
<crosstabCell height="0" rowTotalGroup="orgParentName" columnTotalGroup="title">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
</cellContents>
</crosstabCell>
</crosstab>
</band>
</summary>
</jasperReport>
I used Persian font in the report, but this Persian font is not applied in the xlsx version of the report, but is applied correctly in the pdf version.
I also used the font exception to solve this problem but it did not work for the excel version.
Please help me to display the text and numbers in xlsx like pdf correctly

How to create table with inner rows

How to obtain this situation (move the last column as new dynamic row) in jasper?
Jrxml code: https://pastebin.com/sMa1Cct2
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final utlizzo versione della libreria JasperReports6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b -->
<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="template_Table" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1a0aa80b-dc07-4dca-bdbc-aa78eeb0d12b">
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="ItemDataset" uuid="2914f7c6-c2d7-448b-b0c1-090970e18ed6">
<queryString>
<![CDATA[]]>
</queryString>
<field name="descrizione" class="java.lang.String"/>
<field name="numero_depositanti" class="java.lang.String"/>
<field name="quantita" class="java.lang.String"/>
<field name="percentuale" class="java.lang.String"/>
<field name="conti" class="java.util.List"/>
<group name="Group1"/>
</subDataset>
<parameter name="ItemDataSource" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="256" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="555" height="200" uuid="7786bb05-503a-4b6a-991a-a7bcf3abad07">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table 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="ItemDataset" uuid="d3e1e03a-2c83-4436-9e50-79518bc3d337">
<dataSourceExpression><![CDATA[$P{ItemDataSource}]]></dataSourceExpression>
</datasetRun>
<jr:column width="75" uuid="dca8961f-ce2d-47ac-879c-b15847d170a9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna1"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="75" height="30" uuid="f60d1675-6fb6-4569-93ca-de32b3a8e861"/>
<text><![CDATA[Descrizione]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="75" height="30" uuid="f1de366a-b36f-4200-9b1e-7a0009be5373"/>
<textFieldExpression><![CDATA[$F{descrizione}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna2"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="140" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Numero depositanti]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="140" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{numero_depositanti}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="100" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna3"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="100" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Quantita]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="100" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{quantita}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="100" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna4"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="100" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Percentuale]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="100" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{percentuale}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna5"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="140" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Percentuale]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="140" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{conti}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
<band height="50">
<staticText>
<reportElement x="0" y="0" width="75" height="20" backcolor="#151515" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb6b"/>
<text><![CDATA[descrizione]]></text>
</staticText>
<staticText>
<reportElement x="151" y="0" width="100" height="20" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb68"/>
<text><![CDATA[quantita]]></text>
</staticText>
<staticText>
<reportElement x="226" y="0" width="75" height="20" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb69"/>
<text><![CDATA[percentuale]]></text>
</staticText>
</band>
</detail>
</jasperReport>
Playing around I found another possible way (without the data I can't confirm it working). :
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1 -->
<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="template_Table" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1a0aa80b-dc07-4dca-bdbc-aa78eeb0d12b">
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="ItemDataset" uuid="2914f7c6-c2d7-448b-b0c1-090970e18ed6">
<queryString>
<![CDATA[]]>
</queryString>
<field name="descrizione" class="java.lang.String"/>
<field name="numero_depositanti" class="java.lang.String"/>
<field name="quantita" class="java.lang.String"/>
<field name="percentuale" class="java.lang.String"/>
<field name="conti" class="java.util.List"/>
<group name="Group1"/>
</subDataset>
<parameter name="ItemDataSource" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="256" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="555" height="200" uuid="7786bb05-503a-4b6a-991a-a7bcf3abad07">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table 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="ItemDataset" uuid="d3e1e03a-2c83-4436-9e50-79518bc3d337">
<dataSourceExpression><![CDATA[$P{ItemDataSource}]]></dataSourceExpression>
</datasetRun>
<jr:column width="75" uuid="dca8961f-ce2d-47ac-879c-b15847d170a9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna1"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="75" height="30" uuid="f60d1675-6fb6-4569-93ca-de32b3a8e861"/>
<text><![CDATA[Descrizione]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="60">
<textField>
<reportElement x="0" y="0" width="75" height="60" uuid="f1de366a-b36f-4200-9b1e-7a0009be5373"/>
<textFieldExpression><![CDATA[$F{descrizione}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="225" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna2"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="225" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Numero depositanti]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="60">
<textField>
<reportElement x="0" y="0" width="225" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{numero_depositanti}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="30" width="225" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{conti}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="101" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna3"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="101" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Quantita]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="60">
<textField>
<reportElement x="0" y="0" width="101" height="60" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{quantita}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="99" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna4"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="99" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Percentuale]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="60">
<textField>
<reportElement x="0" y="0" width="99" height="60" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{percentuale}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="55" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Colonna5"/>
<jr:tableHeader height="30" rowSpan="1"/>
<jr:detailCell height="60">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
<band height="50">
<staticText>
<reportElement x="0" y="0" width="75" height="20" backcolor="#151515" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb6b"/>
<text><![CDATA[descrizione]]></text>
</staticText>
<staticText>
<reportElement x="151" y="0" width="100" height="20" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb68"/>
<text><![CDATA[quantita]]></text>
</staticText>
<staticText>
<reportElement x="226" y="0" width="75" height="20" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb69"/>
<text><![CDATA[percentuale]]></text>
</staticText>
</band>
</detail>
</jasperReport>
The only option I see is, that you have to create a new table with only this one property.
Then you can layout it that it looks like one table:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1 -->
<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="template_Table" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1a0aa80b-dc07-4dca-bdbc-aa78eeb0d12b">
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="ItemDataset" uuid="2914f7c6-c2d7-448b-b0c1-090970e18ed6">
<queryString>
<![CDATA[]]>
</queryString>
<field name="descrizione" class="java.lang.String"/>
<field name="numero_depositanti" class="java.lang.String"/>
<field name="quantita" class="java.lang.String"/>
<field name="percentuale" class="java.lang.String"/>
<field name="conti" class="java.util.List"/>
<group name="Group1"/>
</subDataset>
<parameter name="ItemDataSource" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<queryString>
<![CDATA[]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="256" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="555" height="60" uuid="7786bb05-503a-4b6a-991a-a7bcf3abad07">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table 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="ItemDataset" uuid="d3e1e03a-2c83-4436-9e50-79518bc3d337">
<dataSourceExpression><![CDATA[$P{ItemDataSource}]]></dataSourceExpression>
</datasetRun>
<jr:column width="75" uuid="dca8961f-ce2d-47ac-879c-b15847d170a9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="75" height="30" uuid="f60d1675-6fb6-4569-93ca-de32b3a8e861"/>
<text><![CDATA[Descrizione]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="75" height="30" uuid="f1de366a-b36f-4200-9b1e-7a0009be5373"/>
<textFieldExpression><![CDATA[$F{descrizione}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="140" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Numero depositanti]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="140" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{numero_depositanti}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="100" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="100" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Quantita]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="100" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{quantita}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="105" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column4"/>
<jr:tableHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="105" height="30" uuid="16679b95-2e6e-4ca1-b8b6-dd7b74267c56"/>
<text><![CDATA[Percentuale]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="105" height="30" uuid="341e7faf-9680-4941-a9a4-ac78b8f4aae0"/>
<textFieldExpression><![CDATA[$F{percentuale}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="980fffb5-1088-47a6-b00f-b5d08b7093c9">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
<jr:tableHeader height="30" rowSpan="1"/>
<jr:detailCell height="30"/>
</jr:column>
</jr:table>
</componentElement>
<componentElement>
<reportElement x="0" y="60" width="555" height="30" uuid="05eb78da-89c1-4af6-bdad-79a3b8ca819d">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table 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="ItemDataset" uuid="c27bd785-53a9-4bcc-a1cc-3950f707d796">
<dataSourceExpression><![CDATA[$P{ItemDataSource}]]></dataSourceExpression>
</datasetRun>
<jr:column width="75" uuid="7b446ae4-9502-48e3-afd5-6957e705f284">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>
<jr:detailCell height="30"/>
</jr:column>
<jr:column width="345" uuid="06c2486d-3e7c-4b64-9282-e1c58541e69c">
<property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="345" height="30" uuid="8a99019f-ad26-4182-ad81-e61b356dcefe"/>
<textFieldExpression><![CDATA[$F{conti}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
<band height="50">
<staticText>
<reportElement x="0" y="0" width="75" height="20" backcolor="#151515" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb6b"/>
<text><![CDATA[descrizione]]></text>
</staticText>
<staticText>
<reportElement x="151" y="0" width="100" height="20" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb68"/>
<text><![CDATA[quantita]]></text>
</staticText>
<staticText>
<reportElement x="226" y="0" width="75" height="20" uuid="3316e9fe-e7e7-4020-84d6-a8f16cd8eb69"/>
<text><![CDATA[percentuale]]></text>
</staticText>
</band>
</detail>
</jasperReport>

How to introduce the page break after pre-defined number of rows in the jr:table component?

I am using jasper report version 6.1 and wanted page break after pre-defined number of rows in the jr:table component. I have also tried doing the same in version 5 and it works fine but in version 6+ I am not able to do it.
Sharing the links which I followed if any one have other solution please let me know.
http://community.jaspersoft.com/wiki/ireport-how-introduce-page-break-after-pre-defined-number-rows-table-component
http://community.jaspersoft.com/questions/845487/inserting-break-table-print-only-10-rows-page-jasper-reports-372
This is what I have tried:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.1.0.final using JasperReports Library version 6.1.0 -->
<!-- 2017-05-29T15:29:33 -->
<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="Blank_A4_4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="957c1fea-8994-4195-9d7a-2bbf0baf7180">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Max apex"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="Dataset1" uuid="435d51b0-6d3e-442e-9a96-ae7412b12278">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Max apex"/>
<queryString>
<![CDATA[select * from dept]]>
</queryString>
<field name="DEPTNO" class="java.math.BigDecimal"/>
<field name="DNAME" class="java.lang.String"/>
<field name="LOC" class="java.lang.String"/>
<group name="DEPTNO">
<groupExpression><![CDATA[$F{DEPTNO}]]></groupExpression>
</group>
<group name="DNAME">
<groupExpression><![CDATA[$F{DNAME}]]></groupExpression>
</group>
<group name="LOC">
<groupExpression><![CDATA[$F{LOC}]]></groupExpression>
</group>
</subDataset>
<queryString>
<![CDATA[select * from dept]]>
</queryString>
<field name="DEPTNO" class="java.math.BigDecimal"/>
<field name="DNAME" class="java.lang.String"/>
<field name="LOC" class="java.lang.String"/>
<group name="DEPTNO">
<groupExpression><![CDATA[$F{DEPTNO}]]></groupExpression>
</group>
<group name="DNAME">
<groupExpression><![CDATA[$F{DNAME}]]></groupExpression>
</group>
<group name="LOC">
<groupExpression><![CDATA[$F{LOC}]]></groupExpression>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="145" splitType="Stretch">
<componentElement>
<reportElement positionType="FixRelativeToBottom" x="10" y="0" width="500" height="110" uuid="b37c89ae-600a-4fb8-ac64-e142bfe22e13"/>
<jr:table 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="Dataset1" uuid="8f84378b-9508-4763-8265-69e68c41febe">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="100" uuid="00a00921-f5fa-4352-924c-f0531c919f71">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="100" height="30" uuid="d88580f8-05d2-4eb0-a098-00e877c58c39"/>
<text><![CDATA[DEPTNO]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="90" height="30" uuid="15fda94a-b686-4808-b55c-3e08a8e86187"/>
<textFieldExpression><![CDATA[$F{DEPTNO}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="72e58aec-00f1-4937-8600-b32a6010d4d6">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="130" height="30" uuid="942c89ca-e914-4809-bb18-3b7065b413f7"/>
<text><![CDATA[DNAME]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="130" height="30" uuid="8b936e63-5f84-4fd7-b21c-8c08fb9550a5"/>
<textFieldExpression><![CDATA[$F{DNAME}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="140" uuid="f312cbac-4554-492c-928f-dd84b5a55d42">
<jr:columnHeader style="Table_CH" height="30">
<staticText>
<reportElement x="0" y="0" width="120" height="30" uuid="ce385917-88aa-4e51-9cae-a7a142f78323"/>
<text><![CDATA[LOC]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="120" height="30" uuid="0e43f425-558c-4001-9c44-ca14798bcb75"/>
<textFieldExpression><![CDATA[$F{LOC}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
The solution to use a a group expression inside the subdatset works perfectly fine also in jasper reports v6+.
Example (built from code and data from this answer)
Adding groupExpression to the subDataset to break to new page every 2 records ($V{REPORT_COUNT}-1)/2)
<subDataset name="tableDataset" uuid="7a53770f-0350-4a73-bfc1-48a5f6386594">
<field name="User" class="java.lang.String"/>
<field name="Rep" class="java.math.BigDecimal"/>
<group name="pageBreakGroup" isStartNewPage="true">
<groupExpression><![CDATA[(int)(($V{REPORT_COUNT}-1)/2)]]></groupExpression>
</group>
</subDataset>
Expand code snippet for full 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="reputation" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a88bd694-4f90-41fc-84d0-002b90b2d73e">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="CVS"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="tableDataset" uuid="7a53770f-0350-4a73-bfc1-48a5f6386594">
<field name="User" class="java.lang.String"/>
<field name="Rep" class="java.math.BigDecimal"/>
<group name="pageBreakGroup" isStartNewPage="true">
<groupExpression><![CDATA[(int)(($V{REPORT_COUNT}-1)/2d)]]></groupExpression>
</group>
</subDataset>
<parameter name="displayRecordNumber" class="java.lang.Boolean">
<defaultValueExpression><![CDATA[true]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<title>
<band height="50">
<componentElement>
<reportElement key="table" style="table" x="0" y="0" width="555" height="47" uuid="76ab08c6-e757-4785-a43d-b65ad4ab1dd5"/>
<jr:table 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="tableDataset" uuid="07e5f1c2-af7f-4373-b653-c127c47c9fa4">
<dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression>
</datasetRun>
<jr:column width="90" uuid="918270fe-25c8-4a9b-a872-91299cddbc31">
<printWhenExpression><![CDATA[$P{displayRecordNumber}]]></printWhenExpression>
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30" uuid="5cd6da41-01d5-4f74-99c2-06784f891d1e"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Record number]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="30" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="30" uuid="5fe48359-0e7e-44b2-93ac-f55404189832"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="7979d8a2-4e3c-42a7-9ff9-86f8e0b164bc">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30" uuid="61d5f1b6-7677-4511-a10c-1fb8a56a4b2a"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Username]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="30" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="30" uuid="a3cdb99d-3bf6-4c66-b50c-259b9aabfaef"/>
<box leftPadding="3" rightPadding="3"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{User}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="625e4e5e-5057-4eab-b4a9-c5b22844d25c">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30" uuid="e1c07cb8-a44c-4a8d-8566-5c86d6671282"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Reputation]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="30" rowSpan="1">
<textField pattern="#,##0">
<reportElement x="0" y="0" width="90" height="30" uuid="6be2d79f-be82-4c7b-afd9-0039fb8b3189"/>
<box leftPadding="3" rightPadding="3"/>
<textElement textAlignment="Right" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{Rep}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</title>
</jasperReport>
Result in JasperStudio version 6.2
As you can see 3 pages (2 records on each, total record count 5).

How to set the style condtions in jasper for the tables in the sub dataset

I want my table contents to be colored depending on the conditions. My table is present in the sub datasource and the fields that are populated are from the same. Now I want to color the contents depending on some conditions.
NOTE: all the data present in the fields are of type string. So I started creating the a style and adding a condition to it using the parameter which I thought of passing from java at runtime, It says an error parameter not found. So i tried using Fields in the main report by adding the same fields of sub datasource to the main report, its says retrieving data to the field failed. How am I suppose to check for the conditions in the style.
Here's my code
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
<!-- 2016-01-13T14:56:39 -->
<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="360FeedbackJasper" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b2b320e6-05ba-442a-ae37-11e094fd08f1">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="360feedbackAdapter"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="DM_STYLE">
<conditionalStyle>
<conditionExpression><![CDATA[$F{dmScore}.equals("12")]]></conditionExpression>
<style mode="Opaque" forecolor="#292323" backcolor="#D91511"/>
</conditionalStyle>
</style>
<subDataset name="table1dataset" uuid="d9e6ff71-23d5-4eb7-b8ef-fcd1bc653360">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="360feedbackAdapter"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="dmScore" class="java.lang.String">
<fieldDescription><![CDATA[dmScore]]></fieldDescription>
</field>
<field name="shScore" class="java.lang.String">
<fieldDescription><![CDATA[shScore]]></fieldDescription>
</field>
<field name="selfScore" class="java.lang.String">
<fieldDescription><![CDATA[selfScore]]></fieldDescription>
</field>
<field name="maxScore" class="java.lang.String">
<fieldDescription><![CDATA[maxScore]]></fieldDescription>
</field>
<field name="avgScore" class="java.lang.String">
<fieldDescription><![CDATA[avgScore]]></fieldDescription>
</field>
<field name="peScore" class="java.lang.String">
<fieldDescription><![CDATA[peScore]]></fieldDescription>
</field>
<field name="mergeScore" class="java.lang.String">
<fieldDescription><![CDATA[mergeScore]]></fieldDescription>
</field>
<field name="drScore" class="java.lang.String">
<fieldDescription><![CDATA[drScore]]></fieldDescription>
</field>
<field name="driver" class="java.lang.String">
<fieldDescription><![CDATA[driver]]></fieldDescription>
</field>
<field name="ques" class="java.lang.String">
<fieldDescription><![CDATA[ques]]></fieldDescription>
</field>
</subDataset>
<parameter name="OTHERS" class="java.lang.String" isForPrompting="false"/>
<parameter name="OTHERS_VALUE" class="java.lang.String" isForPrompting="false"/>
<parameter name="SHOWDM" class="java.lang.Boolean" isForPrompting="false">
<defaultValueExpression><![CDATA[new Boolean(false)]]></defaultValueExpression>
</parameter>
<parameter name="SHOWDR" class="java.lang.Boolean" isForPrompting="false">
<defaultValueExpression><![CDATA[new Boolean(false)]]></defaultValueExpression>
</parameter>
<parameter name="SHOWPE" class="java.lang.Boolean" isForPrompting="false">
<defaultValueExpression><![CDATA[new Boolean(false)]]></defaultValueExpression>
</parameter>
<parameter name="SHOWSH" class="java.lang.Boolean" isForPrompting="false">
<defaultValueExpression><![CDATA[new Boolean(false)]]></defaultValueExpression>
</parameter>
<parameter name="SHOWOT" class="java.lang.Boolean" isForPrompting="false">
<defaultValueExpression><![CDATA[new Boolean(false)]]></defaultValueExpression>
</parameter>
<parameter name="SHOWAVG" class="java.lang.Boolean" isForPrompting="false">
<defaultValueExpression><![CDATA[new Boolean(false)]]></defaultValueExpression>
</parameter>
<parameter name="DM_STYLE_PARAM" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["RED"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<field name="overAllSummaryReportWithOthers" class="java.util.List">
<fieldDescription><![CDATA[overAllSummaryReportWithOthers]]></fieldDescription>
</field>
<field name="dmScore" class="java.lang.String">
<fieldDescription><![CDATA[dmScore]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
.
.
.
.
<band height="261">
<componentElement>
<reportElement style="DM_STYLE" x="4" y="130" width="554" height="80" uuid="a9101195-3ec3-4fcd-acdd-f4f0665b9c5b">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
<jr:table 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="table1dataset" uuid="360bff8e-005d-461c-a00f-2c990a894735">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{overAllSummaryReportWithOthers})]]></dataSourceExpression>
</datasetRun>
<jr:column width="154" uuid="0b4b40f3-54c6-462a-90a4-d8f32a62be93">
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="154" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="a3280d8e-c3ff-4972-91eb-6e8da7f866ee"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[driver]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="154" height="30" uuid="12ab2c78-afbb-4db5-9a01-16b28cf3d9fa"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{driver}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="8d57520d-e982-430a-afd3-4121f4bd4600">
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="d7a9ad1e-09b5-4791-8bd4-ca37e904fd51"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[maxScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="d339341c-b0ca-4482-b0ca-651be075fe60"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{maxScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="1a391443-bc9c-4be0-86cb-a3b8dec388f4">
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="9c73ca1a-1521-48aa-b905-2ecfeb075cbe"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[selfScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="eced711e-cca2-4fd3-9d2c-46dd4787fe7d"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{selfScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="269e656a-93bf-4f52-bcd1-b3e1c1a6436e">
<printWhenExpression><![CDATA[new Boolean($P{SHOWDM})]]></printWhenExpression>
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="26a14484-4368-4cce-b6cf-c9a4280abe0c"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[dmScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement style="DM_STYLE" x="0" y="0" width="50" height="30" uuid="d43d838c-4eb7-4dd0-8afb-d7a4590dabff"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{dmScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="347a38dd-a69f-446a-92ab-3ed4502cbad6">
<printWhenExpression><![CDATA[new Boolean($P{SHOWDR})]]></printWhenExpression>
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="ef3a228b-47f3-461c-a2c8-88c16eca5049"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[drScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="a834e7b5-7413-442b-9f8e-aee67590bede"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{drScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="20c307cd-1e54-4a42-8cc4-1540da53cc57">
<printWhenExpression><![CDATA[new Boolean($P{SHOWPE})]]></printWhenExpression>
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="a45e2224-b314-4519-aac4-e1e14500071e"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[peScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="c0d60f60-20b6-414f-9c5e-9b5033386d5f"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{peScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="0e710e32-ff08-4ce4-96c3-b505e3ecb3ed">
<printWhenExpression><![CDATA[new Boolean($P{SHOWSH})]]></printWhenExpression>
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="6eb72492-9b2a-4822-b306-903c220c40c1"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[shScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="dff321ae-a25f-4224-94a6-096bcc232ce1"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{shScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="fb2ee2a9-3156-42a1-95ee-aa35fe630fc5">
<printWhenExpression><![CDATA[new Boolean($P{SHOWOT})]]></printWhenExpression>
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="48bee6a2-8f4b-4280-9fa0-24a2dad19c06"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[mergeScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="72b1c817-d6be-470d-8243-514e77b67d26"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{mergeScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="50" uuid="f292fb3e-0f95-4e24-8d27-763d15f390af">
<printWhenExpression><![CDATA[new Boolean($P{SHOWAVG})]]></printWhenExpression>
<jr:columnHeader style="Table_CH" height="50">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="50" height="50" forecolor="#000000" backcolor="#E0E0E0" uuid="027dbe79-5e7c-47ec-a658-5c4a1bd53699"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" isBold="true"/>
</textElement>
<text><![CDATA[avgScore]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="Table_TD" height="30">
<textField>
<reportElement x="0" y="0" width="50" height="30" uuid="c7ac4bbb-1543-4d48-a524-0dc75fc0e6b5"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{avgScore}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
<staticText>
<reportElement x="-1" y="50" width="225" height="20" uuid="5c083db9-dcc4-48e4-b72d-764490baaf03"/>
<textElement>
<font fontName="SansSerif"/>
</textElement>
<text><![CDATA[Detailed Bahavior-wise Report]]></text>
</staticText>
<textField>
<reportElement x="12" y="91" width="100" height="30" uuid="30a8aeab-8307-42e6-b375-da90350b6790"/>
<textFieldExpression><![CDATA[$P{DM_STYLE_PARAM}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
If you define a conditional expression on a style, you can only use that style in its scope.
In your example:
<conditionExpression><![CDATA[$F{dmScore}.equals("12")]]></conditionExpression>
The scope of $F{dmScore} is when you are running the subDataset="table1dataset", hence inside of the <jr:table> tag.
This style should only be used inside of this tag, scope.
Solution:
Remove all style declaration of DM_STYLE that are out of scope as for example.
<reportElement style="DM_STYLE" x="4" y="130" width="554" height="80" uuid="a9101195-3ec3-4fcd-acdd-f4f0665b9c5b">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
</reportElement>
Regarding your previous problem when using parameter you probably forgot to pass this parameter to the jr:table and since you where using it inside you had same problem but reversed. The solution of this would have been to create same parameter in subdataset and then pass it.
<datasetRun subDataset="table1dataset" uuid="93792e42-02d5-4121-84a6-312310e190a0">
<datasetParameter name="yourParam">
<datasetParameterExpression><![CDATA[$P{yourParam}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{overAllSummaryReportWithOthers})]]></dataSourceExpression>
</datasetRun>

iReport: Getting multiple copies of table in detail band

I am new at iReport. So I want to make a simple report based on data.
My problem is when my rows are less then detail band's size the whole table gets repeated in detail band, and I dont want it again. If my rows are aproximately 5, then same table gets copied 4 times in detail band, and not only table but each and every thing I put in detail band. It gets repeated itself till detail band limits come.
So am I making some mistake, or I have to set some property of detail band in iReport?
please help me friends. Thanks in advance.
This is the generated result:
Here is my code of jrxml:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport language="groovy" bottomMargin="20" topMargin="20" rightMargin="20" leftMargin="20" columnWidth="555"
whenNoDataType="AllSectionsNoDetail" pageHeight="842" pageWidth="595" name="test"
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jasperreports.sourceforge.net/jasperreports">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineColor="#000000" lineWidth="1.0"/>
</box>
</style>
<style name="table_TH" backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table_CH" backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table_TD" backcolor="#FFFFFF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 1">
<box>
<pen lineColor="#000000" lineWidth="1.0"/>
</box>
</style>
<style name="table 1_TH" backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 1_CH" backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 1_TD" backcolor="#FFFFFF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 2">
<box>
<pen lineColor="#000000" lineWidth="1.0"/>
</box>
</style>
<style name="table 2_TH" backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 2_CH" backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 2_TD" backcolor="#FFFFFF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 3">
<box>
<pen lineColor="#000000" lineWidth="1.0"/>
</box>
</style>
<style name="table 3_TH" backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 3_CH" backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 3_TD" backcolor="#FFFFFF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 4">
<box>
<pen lineColor="#000000" lineWidth="1.0"/>
</box>
</style>
<style name="table 4_TH" backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 4_CH" backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 4_TD" backcolor="#FFFFFF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 5">
<box>
<pen lineColor="#000000" lineWidth="1.0"/>
</box>
</style>
<style name="table 5_TH" backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 5_CH" backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<style name="table 5_TD" backcolor="#FFFFFF" mode="Opaque">
<box>
<pen lineColor="#000000" lineWidth="0.5"/>
</box>
</style>
<subDataset name="a">
<parameter name="sem" class="java.lang.String">
<defaultValueExpression>
<![CDATA[]]>
</defaultValueExpression>
</parameter>
<queryString>
<![CDATA[select final."M" as "ENROLLMENT",sem_batch.sem,sem_batch.batch,final."N" as "TTL_WKDY",final."O" as "PRESENT",round(((100*"O")/"N"),2) as "PERCENTAGE" from sem_batch, (select m."Std_id" as "M",l."Batch" as "L",l."Btch" as "N",m."Std" as "O" from (select count(b.batch_id) as "Btch",b.batch_id as "Batch" from batch_wkday b where b.batch_id like $P{sem} group by batch_id) l, (select count(a.std_id) as "Std",a.std_id as "Std_id",s.batch_id as "Batch" from attendance a,student_detail s where a.std_id=s.std_id and s.batch_id like $P{sem} group by a.std_id,s.batch_id) m where l."Batch"=m."Batch") final where final."L"=sem_batch.batch_id]]>
</queryString>
<field name="ENROLLMENT" class="java.math.BigDecimal"/>
<field name="SEM" class="java.math.BigDecimal"/>
<field name="BATCH" class="java.lang.String"/>
<field name="TTL_WKDY" class="java.math.BigDecimal"/>
<field name="PRESENT" class="java.math.BigDecimal"/>
<field name="PERCENTAGE" class="java.math.BigDecimal"/>
<group name="ENROLLMENT">
<groupExpression>
<![CDATA[$F{ENROLLMENT}]]>
</groupExpression>
</group>
</subDataset>
<parameter name="SEM" class="java.lang.String"/>
<queryString>
<![CDATA[select * from sem_batch]]>
</queryString>
<field name="SEM" class="java.math.BigDecimal"/>
<field name="BATCH" class="java.lang.String"/>
<field name="BATCH_ID" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch" height="69">
<staticText>
<reportElement height="53" width="421" y="0" x="68"/>
<textElement markup="none" textAlignment="Center">
<font size="22"/>
</textElement>
<text>
<![CDATA[ATTENDANCE - CLASS ]]>
</text>
</staticText>
</band>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band splitType="Stretch" height="61">
<staticText>
<reportElement height="20" width="53" y="0" x="0"/>
<textElement>
<font size="12"/>
</textElement>
<text>
<![CDATA[SEM]]>
</text>
</staticText>
<staticText>
<reportElement height="20" width="53" y="20" x="0"/>
<textElement>
<font size="12"/>
</textElement>
<text>
<![CDATA[DATE]]>
</text>
</staticText>
<staticText>
<reportElement height="20" width="10" y="0" x="58"/>
<textElement/>
<text>
<![CDATA[:]]>
</text>
</staticText>
<staticText>
<reportElement height="20" width="10" y="20" x="58"/>
<textElement/>
<text>
<![CDATA[:]]>
</text>
</staticText>
<textField pattern="dd/MM/yyyy">
<reportElement height="20" width="100" y="20" x="68"/>
<textElement/>
<textFieldExpression>
<![CDATA[new java.util.Date()]]>
</textFieldExpression>
</textField>
<textField>
<reportElement height="20" width="100" y="0" x="68"/>
<textElement/>
<textFieldExpression>
<![CDATA[$P{SEM}]]>
</textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band splitType="Stretch" height="125">
<componentElement>
<reportElement height="50" width="360" y="0" x="35" style="table 5" key="table 5"/>
<jr:table
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"
xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components">
<datasetRun subDataset="a">
<datasetParameter name="sem">
<datasetParameterExpression>
<![CDATA[$P{SEM}+'%']]>
</datasetParameterExpression>
</datasetParameter>
<connectionExpression>
<![CDATA[$P{REPORT_CONNECTION}]]>
</connectionExpression>
</datasetRun>
<jr:column width="118">
<jr:columnHeader height="23" style="table 5_CH" rowSpan="1">
<staticText>
<reportElement height="20" width="118" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="14" isBold="false"/>
</textElement>
<text>
<![CDATA[ENROLLMENT]]>
</text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="20" style="table 5_TD" rowSpan="1">
<textField>
<reportElement height="20" width="118" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression>
<![CDATA[$F{ENROLLMENT}]]>
</textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader height="23" style="table 5_CH" rowSpan="1">
<staticText>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="14"/>
</textElement>
<text>
<![CDATA[SEM]]>
</text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="20" style="table 5_TD" rowSpan="1">
<textField>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="10"/>
</textElement>
<textFieldExpression>
<![CDATA[$F{SEM}]]>
</textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader height="23" style="table 5_CH" rowSpan="1">
<staticText>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="14"/>
</textElement>
<text>
<![CDATA[BATCH]]>
</text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="20" style="table 5_TD" rowSpan="1">
<textField>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center"/>
<textFieldExpression>
<![CDATA[$F{BATCH}]]>
</textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader height="23" style="table 5_CH" rowSpan="1">
<staticText>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="14"/>
</textElement>
<text>
<![CDATA[PRESENT]]>
</text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="20" style="table 5_TD" rowSpan="1">
<textField>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center"/>
<textFieldExpression>
<![CDATA[$F{PRESENT}]]>
</textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader height="23" style="table 5_CH" rowSpan="1">
<staticText>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center">
<font size="14"/>
</textElement>
<text>
<![CDATA[PERCENTAGE]]>
</text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="20" style="table 5_TD" rowSpan="1">
<textField>
<reportElement height="20" width="90" y="0" x="0"/>
<textElement textAlignment="Center"/>
<textFieldExpression>
<![CDATA[$F{PERCENTAGE}]]>
</textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band splitType="Stretch" height="54">
<textField>
<reportElement height="20" width="100" y="16" x="227"/>
<textElement textAlignment="Center"/>
<textFieldExpression>
<![CDATA[$V{PAGE_NUMBER}]]>
</textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band splitType="Stretch" height="42"/>
</summary>
</jasperReport>
You should put the table component into the Title band (or into the Summary band, for example). Not into the Detail band.
Select Table Properties and add
printWhenExpression on the table to $V{REPORT_COUNT} == 1 Now to avoid repetation table values in your ireport.
Based on the previous answer response I was able with the table on the Detail section and the following properties set to avoid generating duplicated nor empty pages at the end of the document.
Detail Band -> set the Print When Expression with value $V{REPORT_COUNT} == 1
Table Element -> Set the Print When Expression $V{REPORT_COUNT} == 1
hey i got the solution of my problem. If in main query more than one rows are returned then such things will happen. Try to give query which returns not more than one row. Like "Select 1 from dual". This solution solved my problem.