I added a data source to my report in iReport Designer , I then dragged some "Text Field"s from the Report Elements palette to the Detail band and I got an error compiling a jasper report:
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid :
[jrc] 1. Field not found : deviceCostsDTO
even the field is declared:
<field name="deviceCostsDTO" class="com.domain.device.DeviceCostsDTO">
<fieldDescription><![CDATA[actionCostsDTO]]></fieldDescription>
</field>
and used here:
<frame>
<reportElement positionType="Float" x="0" y="155" width="802" height="60" isRemoveLineWhenBlank="true" />
<componentElement>
<reportElement x="0" y="36" width="802" height="24" isRemoveLineWhenBlank="true" />
<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="costsPerBeneficiaryDataset" >
<datasetParameter name="P_AC_DTO">
<datasetParameterExpression><![CDATA[$F{deviceCostsDTO}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="DOMAIN_CODE">
<datasetParameterExpression><![CDATA[$F{projectDomain}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{costsPerBeneficiaryWrappers})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="24" width="802">
<frame>
<reportElement positionType="Float" x="0" y="0" width="802" height="24" isRemoveLineWhenBlank="true" />
<textField>
<reportElement x="0" y="0" width="69" height="24" />
<box leftPadding="5" rightPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{beneficiaryShortName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="69" y="0" width="50" height="24" />
<box leftPadding="5" rightPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8"/>
</textElement>
<textFieldExpression class="java.lang.Long"><![CDATA[$F{numberOfPersonDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="119" y="0" width="50" height="24" />
<box leftPadding="5" rightPadding="5">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="8"/>
</textElement>
<textFieldExpression class="java.lang.Long"><![CDATA[((com.domain.device.DeviceCostsDTO)$F{deviceCostsDTO}).getTotalCostPerBeneficiary($F{applicantId})]]></textFieldExpression>
</textField>
</frame>
</jr:listContents>
</jr:list>
</componentElement>
</frame>
You're using this field inside a List. You should declare as a field of the dataset your list is using.
Like this:
<?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" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<subDataset name="testDataset">
<field name="testField" class="java.lang.String"/>
</subDataset>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<detail>
<band height="20" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="791" height="20"/>
<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="testDataset">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="791">
<textField>
<reportElement x="0" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{testField}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</detail>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
Related
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>
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 inserting a table in my detail band, but if the value is too long in my textfield, the value is showed only in the second page and because of this the first page is blank.
How I can avoid empty first page on Ireport?
Below is my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioLicenca" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="089efa24-5b40-467a-b66a-053b77756f0c">
<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="0.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="dataset1" uuid="7664203f-829d-4951-8151-f0c3630108d3"/>
<subDataset name="dataset2" uuid="b05d44f7-3dfe-4fb8-9014-34c037e8bc28"/>
<subDataset name="dataset3" uuid="f3336d08-b905-45da-9cd2-871a08fbb704"/>
<subDataset name="dataset4" uuid="8a31051f-53a0-4438-8f36-655294512ecb"/>
<subDataset name="itemDataSet" uuid="07d68903-44a5-4148-9f4e-46a764459558">
<field name="html" class="java.lang.String"/>
</subDataset>
<parameter name="LOGO_IMAGE" class="java.io.InputStream"/>
<parameter name="BARRA_IMAGE" class="java.io.InputStream"/>
<parameter name="listCriterioQci" class="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="73" splitType="Stretch">
<image>
<reportElement x="137" y="2" width="284" height="54" uuid="07b821b9-797c-439c-92e8-1963c63ee2ae"/>
<imageExpression><![CDATA[$P{LOGO_IMAGE}]]></imageExpression>
</image>
<image>
<reportElement x="0" y="59" width="555" height="14" uuid="4b071978-b491-4bdb-b964-77cc3e378966"/>
<imageExpression><![CDATA[$P{BARRA_IMAGE}]]></imageExpression>
</image>
</band>
</title>
<detail>
<band height="218" splitType="Stretch">
<componentElement>
<reportElement key="table" style="table" positionType="Float" isPrintRepeatedValues="false" mode="Opaque" x="2" y="8" width="553" height="197" isPrintWhenDetailOverflows="true" forecolor="#FFFFFF" uuid="086200b3-e8f8-454d-84ef-d91dbe233d92"/>
<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="376ddebe-37e7-49e4-9a3c-c12cdb054808">
<dataSourceExpression><![CDATA[$P{listCriterioQci}]]></dataSourceExpression>
</datasetRun>
<jr:column width="554" uuid="cc022176-90eb-4639-8818-85293cb2da05">
<jr:detailCell style="table" height="135" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="31" width="554" height="92" isPrintWhenDetailOverflows="true" uuid="75438790-5295-4508-b6fe-cae1b962ae1d"/>
<box>
<pen lineStyle="Solid" lineColor="#FFFFFF"/>
<topPen lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineStyle="Solid" lineColor="#FFFFFF"/>
<bottomPen lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textElement markup="html"/>
<textFieldExpression><![CDATA[$F{html}]]></textFieldExpression>
</textField>
<line>
<reportElement positionType="Float" x="0" y="15" width="554" height="1" uuid="7a8ae78a-41c3-4612-aeff-4aa9bbfe74f5">
<printWhenExpression><![CDATA[new Boolean($F{html} != null)]]></printWhenExpression>
</reportElement>
</line>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
<pageFooter>
<band height="21" splitType="Stretch">
<textField>
<reportElement mode="Opaque" x="342" y="4" width="170" height="13" uuid="26decbd6-15dd-4f66-99d7-132b5b54a889"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement mode="Opaque" x="514" y="4" width="40" height="13" uuid="e34184f8-e277-4ec3-9a69-0c07d0729e25"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="EEEEE dd MMMMM yyyy">
<reportElement x="1" y="4" width="211" height="13" uuid="68ea646b-0cef-4427-86b7-32f0f5bd47f8"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="5" splitType="Stretch"/>
</summary>
</jasperReport>
When i'm trying to preview the data in IReports by clicking the preview tab, it is just flashing and going back, but i'm unable to see the data.
Below is my XML.
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report5" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b8a981bc-ae9b-4fcf-8400-f9ecea0567f2">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Crosstab Data Text" hAlign="Center"/>
<queryString>
<![CDATA[SELECT
`Date assigned` AS Date_assigned,
Units,
`Assigned to PS` AS Assigned_to_PS
FROM
[Sheet1$]
]]>
</queryString>
<field name="Date_assigned" class="java.sql.Timestamp"/>
<field name="Units" class="java.lang.Double"/>
<field name="Assigned_to_PS" class="java.lang.String"/>
<group name="Date_assigned">
<groupExpression><![CDATA[$F{Date_assigned}]]></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="125" splitType="Stretch">
<crosstab>
<reportElement uuid="db476b5b-d93f-4819-a8f6-174bfc88c9b7" x="0" y="0" width="802" height="125"/>
<rowGroup name="Date_assigned" width="70" totalPosition="End">
<bucket class="java.util.Date">
<bucketExpression><![CDATA[$F{Date_assigned}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="cb26a0e2-7fa8-4124-be7f-f91e491801f7" style="Crosstab Data Text" x="0" y="0" width="70" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{Date_assigned}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement uuid="c97deff9-a499-4330-aa84-baf20315a1de" x="0" y="0" width="70" height="25"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Total Date_assigned]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="Assigned_to_PS" height="30" totalPosition="End">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Assigned_to_PS}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="7e26e7de-b54f-4490-9ea1-b087247e9c06" style="Crosstab Data Text" x="0" y="0" width="50" height="30"/>
<textElement/>
<textFieldExpression><![CDATA[$V{Assigned_to_PS}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<staticText>
<reportElement uuid="86c2ceb5-b2d2-4cc7-953e-0c039e807ec1" x="86" y="0" width="50" height="30"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Total Assigned_to_PS]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="UnitssMeasure" class="java.lang.Double" calculation="Sum">
<measureExpression><![CDATA[$F{Unitss}]]></measureExpression>
</measure>
<crosstabCell width="120" height="38">
<cellContents>
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="7729498a-0309-4052-a002-e58592da972b" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="120" height="61" rowTotalGroup="Date_assigned">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="35ba6c60-5505-4eba-be7b-8627a9516c7d" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="136" height="38" columnTotalGroup="Assigned_to_PS">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="c260e58c-5377-4582-bdfe-59a3f337feee" style="Crosstab Data Text" x="86" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="136" height="61" rowTotalGroup="Date_assigned" columnTotalGroup="Assigned_to_PS">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement uuid="468233cd-75a6-4278-ba3f-de35032a5459" style="Crosstab Data Text" x="86" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UnitssMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
This is actually a pivot table from excel data source, please let me know how do i preview it. And also i'm not getting any errors.
expected output is
Amreen Anirudh Anand Total
7/1/2013 158 158
7/2/2013 23 23
7/3/2013 152 748 900
7/4/2013
7/5/2013
7/6/2013 435 435
7/7/2013 170 170
7/8/2013 66 66
7/9/2013 33 33 66
Total 1037 748 33 1818
Thanks