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>
Related
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).
I have used multiple List components in my project to retrieve data of more than one column with list objects. now i do get data from all list components but can't get rows in sync. like an image below.
as shown in image i cant get rows in sync although all columns have the same number of data (20):
I have used total 7 list components in this report. and here is my report design below.
This is my report design:
And now, this is my XML code of ireport below.
<?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="Patient_User_Audit_Trail_Test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="9fda934e-ab17-4f3c-b918-18be64af34f8">
<style name="Title" fontName="Arial" fontSize="26" isBold="true"/>
<style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="18"/>
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
<style name="Detail" fontName="Arial" fontSize="12"/>
<subDataset name="dataset2" uuid="bbe5eee2-9a7c-4841-8509-a25b5ea29a1f">
<field name="auditTrailDate" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset1" uuid="180b1e56-06b5-41ac-8a2c-f6c0ca0f15b1">
<field name="entityName" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset3" uuid="16ce9d70-a57d-40c4-8927-6b3e72aab804">
<field name="moduleName" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset4" uuid="bcfad895-054f-4682-a592-14d987c8a847">
<field name="action" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset5" uuid="3a04ea3c-39ce-4372-8c23-7e92ae47a5f7">
<field name="user" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset6" uuid="3728de41-9b60-407c-a1b6-32cb0d4cc274">
<field name="version" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<subDataset name="dataset7" uuid="51f1da76-232a-4cc9-9bb2-b4788e3d1e32">
<field name="ipAddress" class="java.lang.String">
<fieldDescription><![CDATA[_THIS]]></fieldDescription>
</field>
</subDataset>
<field name="auditTrailDate" class="java.util.Date"/>
<field name="entityName" class="java.lang.String"/>
<field name="moduleName" class="java.lang.String"/>
<field name="user" class="java.lang.String"/>
<field name="action" class="java.lang.String"/>
<field name="version" class="java.lang.String"/>
<field name="ipAddress" class="java.lang.String"/>
<field name="patientUserAuditTrailList" class="java.util.Collection"/>
<field name="patientUserAuditTrailList1" class="java.util.Collection"/>
<field name="patientUserAuditTrailList2" class="java.util.Collection"/>
<field name="patientUserAuditTrailList3" class="java.util.Collection"/>
<field name="patientUserAuditTrailList4" class="java.util.Collection"/>
<field name="patientUserAuditTrailList5" class="java.util.Collection"/>
<field name="patientUserAuditTrailList6" class="java.util.Collection"/>
<title>
<band height="70" splitType="Stretch">
<staticText>
<reportElement style="Title" stretchType="RelativeToTallestObject" x="0" y="8" width="263" height="33" isPrintWhenDetailOverflows="true" uuid="39345e12-619f-46a0-8350-84cd8dee7539">
<property name="net.sf.jasperreports.export.pdf.tag.h1" value="full"/>
</reportElement>
<textElement verticalAlignment="Middle" markup="html"/>
<text><![CDATA[Omscer Audit Report]]></text>
</staticText>
<staticText>
<reportElement style="SubTitle" x="2" y="46" width="204" height="22" uuid="2ab3ba89-41a1-474f-927f-fc7e626606a7">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<textElement>
<font size="16"/>
</textElement>
<text><![CDATA[Patient & User Audit Trail]]></text>
</staticText>
<image hAlign="Center" vAlign="Middle" onErrorType="Blank">
<reportElement x="280" y="0" width="275" height="64" uuid="0873284e-25a3-4f37-9975-a0513745458b"/>
<imageExpression><![CDATA["logo_oscer.png"]]></imageExpression>
</image>
</band>
</title>
<columnHeader>
<band height="36" splitType="Stretch">
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="0" y="17" width="79" height="19" uuid="9123f0ea-98d0-49b8-aa2e-d2116c0732a8">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[Date]]></text>
</staticText>
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="79" y="17" width="90" height="19" uuid="b4e4a2cc-bbc1-4aac-9c37-2f121961ab91">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[Entity]]></text>
</staticText>
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="169" y="17" width="84" height="19" uuid="a6e8545a-972f-4f0f-b5eb-f19b688209e9">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[Module]]></text>
</staticText>
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="254" y="17" width="118" height="19" uuid="5313bb2a-28ed-441a-b61d-9ed970a915a8"/>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[Action]]></text>
</staticText>
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="372" y="17" width="62" height="19" uuid="9486a1d0-d31b-4f39-aa41-66f96a4c19dd">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[User]]></text>
</staticText>
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="434" y="17" width="34" height="19" uuid="50a81b3d-328d-4c60-a518-bc53ce7705bd"/>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[Ver. ]]></text>
</staticText>
<staticText>
<reportElement style="Column header" stretchType="RelativeToBandHeight" x="468" y="17" width="87" height="19" uuid="02c4bfc5-72cd-45ac-b8f3-a857c9c21a37">
<property name="com.jaspersoft.studio.unit.y" value="pixel"/>
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<box padding="3" leftPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
<rightPen lineWidth="0.5" lineStyle="Solid" lineColor="#999999"/>
</box>
<textElement>
<font size="10"/>
</textElement>
<text><![CDATA[IP Address]]></text>
</staticText>
<line>
<reportElement positionType="FixRelativeToBottom" x="2" y="35" width="555" height="1" uuid="50fd04da-0661-4a41-a96f-e9cd70bcf437"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#999999"/>
</graphicElement>
</line>
</band>
</columnHeader>
<detail>
<band height="22" splitType="Stretch">
<componentElement>
<reportElement stretchType="RelativeToBandHeight" x="254" y="2" width="118" height="18" uuid="d2ca701a-97d6-4401-91ae-d1e03825b04d"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset4" uuid="bf7c80a4-e6d4-4244-a2f8-e00e361e2ea7">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList3})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="18" width="118">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="118" height="18" isPrintWhenDetailOverflows="true" uuid="d562331b-04e7-4736-a4e5-5eb19b8eb371"/>
<textFieldExpression><![CDATA[$F{action}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<componentElement>
<reportElement key="" style="Detail" stretchType="RelativeToBandHeight" x="0" y="1" width="79" height="18" uuid="819f572f-4075-41bd-bcd6-2e8145d8bdf1"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset2" uuid="3f1af63e-4772-465c-9608-44ac842a86f1">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="18" width="79">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="79" height="18" isPrintWhenDetailOverflows="true" uuid="df1da492-1324-4a3f-9a70-03359daa2545"/>
<textFieldExpression><![CDATA[$F{auditTrailDate}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<componentElement>
<reportElement stretchType="RelativeToBandHeight" x="79" y="1" width="90" height="18" uuid="f0c08800-6047-452e-8b27-d5bfcb21591c"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset1" uuid="26399034-8222-4fdf-af85-06e2adffed77">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList1})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="18" width="90">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="89" height="18" isPrintWhenDetailOverflows="true" uuid="2bae45b7-6cb6-4c82-91ec-71f1c5045042"/>
<textFieldExpression><![CDATA[$F{entityName}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<line>
<reportElement positionType="Float" x="0" y="19" width="555" height="1" isPrintWhenDetailOverflows="true" uuid="0d23f704-a75d-4777-b2d3-109a55a9d6ab"/>
</line>
<componentElement>
<reportElement stretchType="RelativeToBandHeight" x="169" y="1" width="85" height="19" uuid="a92bc530-bcea-4e45-838f-d80b744ec8a5"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset3" uuid="ff0cde48-0c59-4446-a23b-aad4ed204faf">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList2})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="19" width="85">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="85" height="19" isPrintWhenDetailOverflows="true" uuid="730c836d-9447-4c5f-bec8-636054405039"/>
<textFieldExpression><![CDATA[$F{moduleName}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<componentElement>
<reportElement stretchType="RelativeToBandHeight" x="372" y="0" width="62" height="20" uuid="3522afde-1e54-452b-8ad1-cb3184e608fe"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset5" uuid="233d6b96-83a9-48e5-bf87-807a06e88e75">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList4})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="62">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="62" height="20" isPrintWhenDetailOverflows="true" uuid="522ad468-3b38-435f-ae9c-81158c8c321b"/>
<textFieldExpression><![CDATA[$F{user}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<componentElement>
<reportElement stretchType="RelativeToBandHeight" x="434" y="0" width="34" height="20" uuid="3f9477b7-af9c-43ee-9228-6cf02d3a130d"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset6" uuid="0034cf3d-8a1c-4226-94b8-02d34ad7e0d7">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList5})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="34">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="34" height="20" isPrintWhenDetailOverflows="true" uuid="81144da8-9533-431d-a8e9-026bac80a72e"/>
<textFieldExpression><![CDATA[$F{version}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<componentElement>
<reportElement stretchType="RelativeToBandHeight" x="468" y="1" width="87" height="19" uuid="28c5ced0-12b8-4b99-8a9c-b43454f17e2e"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="dataset7" uuid="e4e989c0-f06f-404e-bac2-682d1e7c1708">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{patientUserAuditTrailList6})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="19" width="87">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="87" height="19" isPrintWhenDetailOverflows="true" uuid="c721e0b9-bdd3-4773-9eb9-54f652c33d99"/>
<textFieldExpression><![CDATA[$F{ipAddress}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</detail>
<columnFooter>
<band height="22" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="20" splitType="Stretch">
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement style="Column header" x="0" y="0" width="197" height="20" uuid="a145139c-cb3e-477f-8168-82c059a99b1e"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new Date(System.currentTimeMillis() - (1000 * 60 * 60 * 24))]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement style="Column header" x="512" y="0" width="40" height="20" uuid="631b8ab3-e976-4b83-be6c-51094461ff98"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField>
<reportElement style="Column header" x="432" y="0" width="80" height="20" uuid="3b7df66c-9e19-47ac-921b-785d96d680ed"/>
<textElement textAlignment="Right">
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>
My main purpose is to get these data in sync, but i don't know how to when we are using multiple list components separating every rows.
My question is- how to get those list components rows in sync?
If anyone don't get the question then ask me.
I'm trying to understand how iReport works and how to create a simple jrxml file.
The report has a title and header and the data should be in a table. When I try to check how the report looks like using the preview button, I could see the title and header but not the table (Please note that I use that I clicked the "Use default value" for all fields). When I did not use the default value, I get this error.
Error filling print... net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : name
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : name
at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:809)
at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:156)
at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:400)
at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:151)
Caused by: net.sf.jasperreports.engine.JRException: Error retrieving field value from bean : name
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:123)
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getFieldValue(JRAbstractBeanDataSource.java:96)
at net.sf.jasperreports.engine.data.JRBeanCollectionDataSource.getFieldValue(JRBeanCollectionDataSource.java:109)
Caused by: java.lang.NoSuchMethodException: Unknown property 'name' on class 'class java.lang.String'
at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1322)
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:770)
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:846)
at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:426)
at net.sf.jasperreports.engine.data.JRAbstractBeanDataSource.getBeanProperty(JRAbstractBeanDataSource.java:111)
... 15 more Print not filled. Try to use an EmptyDataSource...
I thought that maybe that problem has something to do with how I typed the data for List. Probably the format is wrong. This is how I typed the sample data
(myName, 5, Manila)
(Based on the screenshot, Is the format correct? I even tried enclosing it in a square bracket but I still get the same error.)
please note that I have 3 columns Name , Age , Address.
But in the error message I noticed this
Unknown property 'name' on class 'class java.lang.String'
which makes me think that I did something wrong when I create the dataset. (Sorry if I used a wrong term).
Anyway, here's the xml generated by iReport.
<?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="firstReport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="597c0716-df6b-42ec-a7c8-863eb1b7174a">
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#7FFFD4">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFFFEA">
<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="#7FFFD4">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_CH" mode="Opaque" backcolor="#BFFFEA">
<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>
<subDataset name="Table Dataset 2" uuid="208e382c-09df-484e-8d2d-a4eb4f4e48ba">
<field name="name" class="java.lang.String"/>
<field name="age" class="java.lang.String"/>
<field name="address" class="java.lang.String"/>
</subDataset>
<parameter name="companyName" class="java.lang.String"/>
<parameter name="date" class="java.util.Date"/>
<parameter name="bean" class="java.util.List"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="32" splitType="Stretch">
<staticText>
<reportElement x="182" y="0" width="184" height="25" uuid="fe64d4b4-efb1-4ed2-ae06-772728fc8b65"/>
<textElement>
<font fontName="Bookman Old Style" size="15" isBold="true"/>
</textElement>
<text><![CDATA[Chart Of Account List]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="58" splitType="Stretch">
<staticText>
<reportElement x="13" y="0" width="100" height="20" uuid="52ae4669-b47e-408c-aabc-e8f470a1d92b"/>
<text><![CDATA[Company]]></text>
</staticText>
<staticText>
<reportElement x="13" y="38" width="100" height="20" uuid="a27fe0e1-9fe6-423f-a006-46c51c7e3e5e"/>
<text><![CDATA[Date Exported]]></text>
</staticText>
<textField>
<reportElement x="113" y="0" width="100" height="20" uuid="1d600fa2-9de4-4999-9222-98a8bcb484f9"/>
<textFieldExpression><![CDATA[$P{companyName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="113" y="38" width="100" height="20" uuid="1147b818-90ae-4b41-a757-19a590db41d7"/>
<textFieldExpression><![CDATA[$P{date}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<componentElement>
<reportElement key="table 1" style="table 1" x="13" y="0" width="270" height="50" uuid="652523bf-b666-47bc-a1aa-fc20fb9e489a"/>
<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 2" uuid="6fcb9950-2d3f-4752-b56d-df7bff1e6991">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{bean})]]></dataSourceExpression>
</datasetRun>
<jr:column width="90" uuid="ee62967c-3669-49fe-a70d-a588ae47439d">
<jr:columnHeader style="table 1_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30" uuid="a0973bfe-815a-498e-8b25-c3320cfe0f62"/>
<text><![CDATA[Name]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 1_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20" uuid="61d8309e-dd7d-4978-b171-9ae9144e2f5c"/>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="76a9e313-d134-420e-898b-7f5f444c4efb">
<jr:columnHeader style="table 1_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30" uuid="f79fdf71-a673-4d3a-8e10-b986d99b8e9b"/>
<text><![CDATA[Age]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 1_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20" uuid="e4342bed-af9c-4541-9e57-a24485d0a94d"/>
<textFieldExpression><![CDATA[$F{age}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="5c38c250-d74e-440c-93cb-3fef8ad38157">
<jr:columnHeader style="table 1_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30" uuid="4656a074-f345-483a-971b-b00c95746ec0"/>
<text><![CDATA[Address]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table 1_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20" uuid="f2cc3d1c-97ef-48c1-b6e4-a12acc4e67ad"/>
<textFieldExpression><![CDATA[$F{address}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
1) What is wrong with the jrxml that I made? Did I supply a wrong formatted data to the table? Or there's just something wrong with how I did the report?
This was fixed by adding "new" keyword in the datasource expression. You will see datasource expression by right clicking table in the Report Inspector. "edit Table Datasource"
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....
The standard column layout can use to achieve this. How can I do it for the table component layout?
It is quite easy. You should add new datasource for Table component and then use it (datasource) in this component.
The sample jrxml:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ... whenNoDataType="AllSectionsNoDetail" ...>
<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">
<queryString language="SQL">
<![CDATA[SELECT id, city, street FROM address ORDER BY city]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="CITY" class="java.lang.String"/>
<field name="STREET" class="java.lang.String"/>
<group name="CITY">
<groupExpression><![CDATA[$F{CITY}]]></groupExpression>
</group>
</subDataset>
<title>
<band height="58" splitType="Stretch">
<componentElement>
<reportElement key="table" style="table" x="0" y="0" width="299" height="46"/>
<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">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="90">
<jr:groupHeader groupName="CITY">
<jr:cell height="30" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<textFieldExpression><![CDATA[$F{CITY}]]></textFieldExpression>
</textField>
</jr:cell>
</jr:groupHeader>
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Id]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Street]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{STREET}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</title>
</jasperReport>
The design in iReport looks like this:
The main report view:
The Table component view:
In this sample I've delete the main datasource and put the Table component to the Title band. I've set whenNoDataType="AllSectionsNoDetail" property for displaying report.
The data in report is grouped by city field.