Freezing the crosstab header - jasper-reports

I would want to know how do I freeze the elements inside crosstab header?
When I host it on the server all the crosstab headers move and this is not giving a good user experience in reading the report.
The first four columns including the headers must be frozen and the rest I need it scrollable. I have used "net.sf.jasperreports.crosstab.floating.headers" value="false". But this freezes everything
<crosstab>
<reportElement x="0" y="0" width="8960" height="340" uuid="2002dcd6-e466-46fd-9819-5b2ba30d037d">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value=""/>
</reportElement>
<crosstabDataset>
<dataset>
<datasetRun subDataset="crosstabdata" uuid="490a0a47-7987-4aed-9e8b-935179a6bee5">
<datasetParameter name="Company">
<datasetParameterExpression><![CDATA[$P{Company}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="Current_History">
<datasetParameterExpression><![CDATA[$P{Current_History}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="Farmer_Survey_Form">
<datasetParameterExpression><![CDATA[$P{Farmer_Survey_Form}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="UtcOffSet">
<datasetParameterExpression><![CDATA[$P{UtcOffSet}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="Field_Staff"<datasetParameterExpression><![CDATA[$P{Field_Staff}]]></datasetParameterExpression></datasetParameter>
<datasetParameter name="Captured_End_Date">
<datasetParameterExpression><![CDATA[$P{Captured_End_Date}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="Captured_Start_Date">
<datasetParameterExpression><![CDATA[$P{Captured_Start_Date}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="end_add_utc">
<datasetParameterExpression><![CDATA[$P{Captured_End_Date} != null ? DateUtils.addMinutes($P{Captured_End_Date},-$P{UtcOffSet}) : null]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="start_add_utc">
<datasetParameterExpression><![CDATA[$P{Captured_Start_Date} != null ? DateUtils.addMinutes($P{Captured_Start_Date},-$P{UtcOffSet}) : null]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="Field_Manager">
<datasetParameterExpression><![CDATA[$P{Field_Manager}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="Manager">
<datasetParameterExpression><![CDATA[$P{Manager}]]></datasetParameterExpression>
</datasetParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
</dataset>
</crosstabDataset>
<crosstabHeaderCell>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="100" height="40" uuid="198c7076-80b5-11e6-ae22-56b6b6499611"/>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Farmer Code]]></text>
</staticText>
<staticText>
<reportElement x="100" y="0" width="100" height="40" uuid="198c72e2-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[FarmerName]]></text>
</staticText>
<staticText>
<reportElement x="200" y="0" width="100" height="40" uuid="198c73fa-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[Village]]></text>
</staticText>
<staticText>
<reportElement x="300" y="0" width="100" height="40" uuid="198c74f4-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[District]]></text>
</staticText>
<staticText>
<reportElement x="400" y="0" width="100" height="40" uuid="198c768e-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[State]]></text>
</staticText>
<staticText>
<reportElement x="500" y="0" width="100" height="40" uuid="198c779c-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[lattitude]]></text>
</staticText>
<staticText>
<reportElement x="600" y="0" width="100" height="40" uuid="198c7864-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[longitude]]></text>
</staticText>
<staticText>
<reportElement x="700" y="0" width="100" height="40" uuid="198c7c42-80b5-11e6-ae22-56b6b6499611"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[CapturedDate]]></text>
</staticText>
</cellContents>
</crosstabHeaderCell>
<rowGroup name="rank1" width="0">
<bucket class="java.lang.Double">
<bucketExpression><![CDATA[$F{rank}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField>
<reportElement x="0" y="0" width="0" height="20" uuid="38d28fa0-f31a-4ca1-ad7f-6fdce4ddc44f"/>
<textFieldExpression><![CDATA[$V{rank1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="c817dc49-73bd-4871-a8e3-cbb5e2fa2620"/>
<text><![CDATA[Total rank1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="FarmerCode1" width="100">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{FarmerCode}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="168a2718-9f0d-4131-96c9-0c114e3ff8a1"/>
<textFieldExpression><![CDATA[$V{FarmerCode1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="b65343ca-e938-45e9-8565-aff709bc57e6"/>
<text><![CDATA[Total FarmerCode1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="FarmerName1" width="100">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{FarmerName}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="91af15e5-a5b6-45e9-b2c6-9b2cab1de178"/>
<textFieldExpression><![CDATA[$V{FarmerName1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="04533255-cfe1-4beb-b8a7-932e15a5f1b1"/>
<text><![CDATA[Total FarmerName1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="Village1" width="100">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Village}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="d212cc45-73b7-451b-b6de-e0db6537d1f4"/>
<textFieldExpression><![CDATA[$V{Village1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="04135372-ac63-4dba-909f-ba1331e28f22"/>
<text><![CDATA[Total Village1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="District1" width="100">
<bucket class="java.lang.Object">
<bucketExpression><![CDATA[$F{nametoroot}.split(",")[0]]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="8125d38d-90dd-4eb2-822c-ec1899b8ecc4"/>
<textFieldExpression><![CDATA[$V{District1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="b00c82d3-eb11-4dce-8946-b16eeca85afd"/>
<text><![CDATA[Total District1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="State1" width="100">
<bucket class="java.lang.Object">
<bucketExpression><![CDATA[$F{nametoroot}.split(",")[1]]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField>
<reportElement x="0" y="0" width="100" height="20" uuid="9fc6f224-0118-4e96-bd44-2e1e8df36aae"/>
<textFieldExpression><![CDATA[$V{State1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="a3872cc6-af19-4e72-85f4-7775fa8d768b"/>
<text><![CDATA[Total State1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="lattitude1" width="100">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{lattitude}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="100" height="20" uuid="e58014c1-039b-45aa-8069-6471ab245b8f"/>
<textFieldExpression><![CDATA[$V{lattitude1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="06946b02-a585-4eda-ad54-5f85501a5fa9"/>
<text><![CDATA[Total lattitude1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="longitude1" width="100">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{longitude}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="100" height="20" uuid="0108e390-490f-4a9e-aa7a-ac7de7350a81"/>
<textFieldExpression><![CDATA[$V{longitude1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="d8154762-5754-4b4b-b9b4-7fdfbd486f0e"/>
<text><![CDATA[Total longitude1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="CapturedDate1" width="100">
<bucket class="java.sql.Timestamp">
<bucketExpression><![CDATA[$F{CapturedDate}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="100" height="20" uuid="3f181f8a-2013-4b6b-a4ea-ba939afe6bc4"/>
<textFieldExpression><![CDATA[$V{CapturedDate1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="c16fa1e1-b80c-4728-8877-0fcc3364a98a"/>
<text><![CDATA[Total CapturedDate1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="FormName1" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{FormName}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<textField>
<reportElement x="0" y="0" width="200" height="20" uuid="7d671d6b-422a-4b00-b536-a6e6f846d88f">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{FormName1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="341b77e7-f4ac-4352-81e5-f8fa5a8af442"/>
<text><![CDATA[Total FormName1]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<columnGroup name="Attribute1" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Attribute}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Crosstab 3_CH">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="200" height="20" uuid="060b8f03-d7fa-492f-a3fb-08ee3dafdb5a">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{Attribute1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="99185f30-74d4-4ae5-aa3e-1f4b6cc8eed2"/>
<text><![CDATA[Total Attribute1]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="Attributevalue_MEASURE1" class="java.lang.String">
<measureExpression><![CDATA[$F{Attributevalue}]]></measureExpression>
</measure>
<crosstabCell width="200" height="20">
<cellContents mode="Opaque" style="Crosstab 3_CD">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="200" height="20" uuid="ba8179f7-039a-4aac-92c4-ff546113e544">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="1d9f4518-7bd9-494e-b061-844f540d772e"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="7802e2dd-b2b4-401b-b2d4-1ce1be3e790b"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="rank1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="878597c2-4e38-4a57-9a84-912a88c48289"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="rank1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="5d579afa-0c94-4227-a58d-962e81329eee"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="rank1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="eed44e6c-85d8-454e-9a34-23a5c93f4acb"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="FarmerCode1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="ac0edef8-c7ec-4d4f-9fd7-f867bce25f73"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="FarmerCode1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="08af03ed-dd78-40d1-aba2-fad2c53ed691"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="FarmerCode1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="ff140bb6-c126-45e7-ac73-78a77e9f312b"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="FarmerName1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="374b45ee-e9d1-405c-9045-aaeecd9ae780"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="FarmerName1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="c101c960-296a-4984-a36f-106922d4b1ca"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="FarmerName1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="a8b25a61-6cdb-4ef4-b9cd-87429d7266a2"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="Village1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="fc053106-7025-4416-9544-18c6a2f6720b"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="Village1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="de5e0572-f8e8-438a-82b8-f6132c07a663"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="Village1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="e7c102ea-669b-4cd7-8fa3-84d59e7a7d93"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="District1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="229b2d92-3515-44ce-b120-a9da7263f924"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="District1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="8fe0fafd-14fb-4dfe-87ae-813285f16cc2"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="District1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="35fb8c8b-f214-4416-8e8e-c8fc19a848c8"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="State1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="822a8aff-a259-4ef2-a7ff-4e9089d31354"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="State1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="775feca9-2743-4a2f-9cd1-415180acc41e"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="State1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="ee04875d-82db-4cf9-b7d0-183c44fe6a87"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="lattitude1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="64232cdc-01c6-4973-9efa-0724307e71de"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="lattitude1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="8d46bd61-bfbc-495a-95ae-b35cb8c870b8"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="lattitude1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="2724982d-83bb-4734-8b29-617eb0e9f93d"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="longitude1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="9e2225ac-67e5-4c98-9007-ea5b9cd8e68e"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="longitude1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="17a2a9d9-a57a-48a9-adba-94ef365fac2b"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="longitude1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="fdd9bf19-5bf7-49d1-b4ac-9a11581b6c15"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="CapturedDate1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="fcab56b2-9ff2-41ef-80b7-b289ccef15c6"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="CapturedDate1" columnTotalGroup="FormName1">
<cellContents mode="Opaque" style="Crosstab 3_CT">
<textField>
<reportElement x="0" y="0" width="60" height="20" forecolor="#FFFFFF" uuid="dc9ca09a-6289-4a2b-afcc-7824754233f0"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="CapturedDate1" columnTotalGroup="Attribute1">
<cellContents mode="Opaque" style="Crosstab 3_CG">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="1f74ff2e-adb5-4779-be51-aad537d57e17"/>
<textFieldExpression><![CDATA[$V{Attributevalue_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
Any ideas on this would be very helpful

Related

Crosstab table is not incrementing in jasper report

I have try to generated table from query using pivot. But when i tried to compile, the row is incremented but the colomn not increment. I have try to generated the query to pivot table in adf, and the colomn is generated. This is my code:
<band height="303">
<crosstab>
<reportElement x="1" y="0" width="499" height="200" uuid="77f9d29c-5ef4-4cd8-8b35-c18e7a70831d"/>
<rowGroup name="KOMPETENSI1" width="60">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{KOMPETENSI}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab 2_CH">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="9cebd928-d666-4221-99bf-ef5a6d917ab1"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{KOMPETENSI1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="2975a46b-27d0-4e72-aec0-9e4116cee446"/>
<text><![CDATA[Total KOMPETENSI1]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="TAHUN1" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{TAHUN}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Crosstab 2_CH">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="8f43f54c-6de3-407b-b36f-34d3b559cc02"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{TAHUN1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="6a20de24-7100-495f-9e85-c82d9924e69a"/>
<text><![CDATA[Total TAHUN1]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<columnGroup name="JOB1" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{JOB}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Crosstab 2_CH">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="18d62d4b-e2e9-4ecf-b68a-f97f436d571d"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{JOB1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="68d57411-4634-4383-aaa6-a7f6f4fa8c8f"/>
<text><![CDATA[Total JOB1]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<columnGroup name="JENJAB1" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{JENJAB}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Crosstab 2_CH">
<textField>
<reportElement x="0" y="0" width="60" height="20" uuid="a46d026b-99c0-44c1-a7f0-b1b1deb8ea45"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{JENJAB1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents>
<staticText>
<reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="2b6f1d48-25aa-4345-9725-6065a99c72cc"/>
<text><![CDATA[Total JENJAB1]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="LEVEL_JOB_MEASURE1" class="java.lang.String">
<measureExpression><![CDATA[$F{LEVEL_JOB}]]></measureExpression>
</measure>
<measure name="LEVEL_KOMPETENSI_MEASURE1" class="java.lang.String">
<measureExpression><![CDATA[$F{LEVEL_KOMPETENSI}]]></measureExpression>
</measure>
<crosstabCell width="60" height="20">
<cellContents mode="Opaque" style="Crosstab 2_CD">
<textField>
<reportElement x="0" y="0" width="60" height="10" uuid="8d786258-a3ba-447e-b7a6-d515b3b83495"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" uuid="a052bd65-583b-4e65-ba9c-fb705fa8762e"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" columnTotalGroup="TAHUN1">
<cellContents mode="Opaque" style="Crosstab 2_CT">
<textField>
<reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="10f3a0a6-8da7-4eea-bd76-080ec3ac457d"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="ff6b097f-377b-450d-9f31-c2d615c689f0"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" columnTotalGroup="JOB1">
<cellContents mode="Opaque" style="Crosstab 2_CG">
<textField>
<reportElement x="0" y="0" width="60" height="10" uuid="d26f9674-e4c4-4ffb-8cc5-b4b83c2e5000"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" uuid="9cb43185-e1e8-42f9-8ba7-ec6b31a4f3f2"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" columnTotalGroup="JENJAB1">
<cellContents mode="Opaque" style="Crosstab 2_CG">
<textField>
<reportElement x="0" y="0" width="60" height="10" uuid="b40177ac-bbc2-416e-969c-8f21007ee4b6"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" uuid="814d6eff-61a6-430c-a2bf-fa2a92467496"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="KOMPETENSI1">
<cellContents mode="Opaque" style="Crosstab 2_CT">
<textField>
<reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="eedbded2-f179-4d9c-a38a-0e188854a3c4"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="2fd20c2a-8472-41d9-bef1-aa5ae54c1332"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="KOMPETENSI1" columnTotalGroup="TAHUN1">
<cellContents mode="Opaque" style="Crosstab 2_CT">
<textField>
<reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="524a4a98-6e1c-4d4b-974b-ce12dd00afd9"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="7b5692a4-9bc7-4499-9c52-c3cac33ff921"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="KOMPETENSI1" columnTotalGroup="JOB1">
<cellContents mode="Opaque" style="Crosstab 2_CT">
<textField>
<reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="40ad1b84-ff41-46e1-b7c2-85a347a72ae3"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="f2b21bb4-1125-4e3d-8476-dfbc846bd2f6"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="KOMPETENSI1" columnTotalGroup="JENJAB1">
<cellContents mode="Opaque" style="Crosstab 2_CT">
<textField>
<reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="ab621e9e-d237-46db-96a2-2203c54ef55a"/>
<textFieldExpression><![CDATA[$V{LEVEL_JOB_MEASURE1}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="f806f467-6c8c-4dcb-a05c-f7f181b0b064"/>
<textFieldExpression><![CDATA[$V{LEVEL_KOMPETENSI_MEASURE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
</band>
This is my result pivot table:
I want the result like this:
If you see, the year of the table is not increment, how to fix it?
the query:
select CASE WHEN (JENJAB like 'SEVP') THEN '4'
WHEN (JENJAB like 'EVP') THEN '4' WHEN (JENJAB like 'SVP') THEN '4'
WHEN (JENJAB like 'SVP') THEN '4' WHEN (JENJAB like 'AVP') THEN '3'
WHEN (JENJAB like 'AVP') THEN '2' END AS LEVEL_JOB, kompetensi,
level_kompetensi, tahun, job, jenjab from OL_ASSESSMENT_RESULT
where tahun in (select tahun from ( select distinct tahun
from OL_ASSESSMENT_RESULT order by tahun desc)
where ROWNUM <=3 ) and npp = $P{npp}
The result of query:

How to put jasper report cross tab and time series chart in one chart

I want to make jasper report which includes time series and cross tab in one report.
Below is my code which displays the time series properly but cross tab displays only half data.
<?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" pageWidth="590" pageHeight="595" columnWidth="550" 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="46"/>
<style name="Crosstab Data Text" hAlign="Center"/>
<parameter name="citizenID" class="java.lang.String"/>
<parameter name="ContactType" class="java.lang.String"/>
<parameter name="bloodGroup" class="java.lang.String"/>
<parameter name="name" class="java.lang.String"/>
<parameter name="MaritalStatus" class="java.lang.String"/>
<parameter name="DOB" class="java.lang.String"/>
<parameter name="citizenPhotoImg" class="java.lang.String"/>
<parameter name="ContactDetails" class="java.lang.String"/>
<parameter name="gender" class="java.lang.String"/>
<parameter name="address" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT tbPatientMeasurement.MeasurementValue, tbPatientMeasurement.Taken, tbMeasurement.MeasurementName, tbPatientMeasurement.MeasurementIDF,
tbUOM.UOMName, tbPatientMeasurement.PatientMeasurementIDP, REPLACE(REPLACE(REPLACE(CONVERT(CHAR(19), CONVERT(DATETIME, DATEADD(month, 0,
tbPatientMeasurement.Taken), 101), 121), '-', ','), ' ', ','), ':', ',') AS Created, tbVitalDisplayConfig.SequenceID, tbPatientMeasurement.CitizenIDF
FROM tbPatientMeasurement INNER JOIN
tbMeasurement ON tbPatientMeasurement.MeasurementIDF = tbMeasurement.MeasurementIDP INNER JOIN
tbUOM ON tbMeasurement.DefaultUOM = tbUOM.UOMIDP INNER JOIN
tbPatientChartConfig ON tbMeasurement.MeasurementIDP = tbPatientChartConfig.MeasurementIDF LEFT OUTER JOIN
tbVitalDisplayConfig ON tbMeasurement.MeasurementIDP = tbVitalDisplayConfig.MeasurementIDF
WHERE (tbPatientMeasurement.CitizenIDF = 16)
ORDER BY CASE WHEN SequenceID IS NULL THEN 1 ELSE 0 END, tbVitalDisplayConfig.SequenceID]]>
</queryString>
<field name="MeasurementValue" class="java.lang.String"/>
<field name="Taken" class="java.sql.Timestamp"/>
<field name="MeasurementName" class="java.lang.String"/>
<field name="MeasurementIDF" class="java.lang.Integer"/>
<field name="UOMName" class="java.lang.String"/>
<field name="PatientMeasurementIDP" class="java.lang.Integer"/>
<field name="SequenceID" class="java.lang.Integer"/>
<field name="CitizenIDF" class="java.lang.Integer"/>
<field name="measurementName" class="java.lang.String"/>
<field name="measurementValue" class="java.lang.String"/>
<field name="created" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="131">
<textField>
<reportElement x="273" y="44" width="51" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{gender}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="324" y="56" width="78" height="14"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{ContactType}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="68" y="44" width="52" height="14"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[DOB :]]></text>
</staticText>
<line>
<reportElement x="11" y="107" width="530" height="1"/>
</line>
<staticText>
<reportElement stretchType="RelativeToBandHeight" x="238" y="108" width="100" height="20"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Vital Chart]]></text>
</staticText>
<textField>
<reportElement x="120" y="56" width="78" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{citizenID}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="200" y="56" width="73" height="14"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Marital Status : ]]></text>
</staticText>
<staticText>
<reportElement x="324" y="44" width="78" height="14"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Blood Group :]]></text>
</staticText>
<textField>
<reportElement x="120" y="44" width="80" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{DOB}]]></textFieldExpression>
</textField>
<image>
<reportElement x="10" y="10" width="58" height="70"/>
<imageExpression><![CDATA[$P{citizenPhotoImg}]]></imageExpression>
</image>
<line>
<reportElement x="11" y="127" width="530" height="1"/>
</line>
<textField>
<reportElement x="402" y="44" width="136" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{bloodGroup}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="273" y="56" width="51" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{MaritalStatus}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="200" y="44" width="73" height="14"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[Gender :]]></text>
</staticText>
<textField>
<reportElement x="402" y="58" width="136" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{ContactDetails}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="68" y="26" width="473" height="14"/>
<textElement/>
<textFieldExpression><![CDATA[$P{address}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="68" y="10" width="292" height="16"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{name}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="68" y="56" width="52" height="14"/>
<textElement>
<font isBold="true"/>
</textElement>
<text><![CDATA[MedicoID : ]]></text>
</staticText>
</band>
</title>
<lastPageFooter>
<band height="355">
<timeSeriesChart>
<chart isShowLegend="true" evaluationTime="Report" renderType="draw">
<reportElement positionType="FixRelativeToBottom" mode="Transparent" x="0" y="0" width="550" height="322" isPrintWhenDetailOverflows="true"/>
<chartTitle position="Top"/>
<chartSubtitle/>
<chartLegend/>
</chart>
<timeSeriesDataset timePeriod="Milisecond">
<timeSeries>
<seriesExpression><![CDATA[$F{measurementName}]]></seriesExpression>
<timePeriodExpression><![CDATA[new SimpleDateFormat("yyyy,MM,dd,HH,mm").parse($F{created})]]></timePeriodExpression>
<valueExpression><![CDATA[Double.valueOf($F{measurementValue})]]></valueExpression>
</timeSeries>
</timeSeriesDataset>
<timeSeriesPlot isShowLines="true" isShowShapes="true">
<plot backgroundAlpha="1.0" labelRotation="55.0"/>
</timeSeriesPlot>
</timeSeriesChart>
</band>
</lastPageFooter>
<summary>
<band height="127" splitType="Stretch">
<crosstab ignoreWidth="true">
<reportElement positionType="Float" x="0" y="0" width="550" height="104"/>
<crosstabHeaderCell>
<cellContents backcolor="#66FF33"/>
</crosstabHeaderCell>
<rowGroup name="Taken" width="0">
<bucket order="Descending" class="java.lang.String">
<bucketExpression><![CDATA[(new SimpleDateFormat("yyyy")).format($F{Taken})]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="0" height="0"/>
<textElement/>
<textFieldExpression><![CDATA[$V{Taken}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents/>
</crosstabTotalRowHeader>
</rowGroup>
<rowGroup name="Taken1" width="93">
<bucket order="Descending" class="java.lang.String">
<bucketExpression><![CDATA[(new SimpleDateFormat("dd-MM-yyyy HH:mm")).format($F{Taken})]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="93" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$V{Taken1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents/>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="SequenceID" height="0">
<bucket class="java.lang.Integer">
<bucketExpression><![CDATA[$F{SequenceID}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="0" height="0"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$V{SequenceID}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents/>
</crosstabTotalColumnHeader>
</columnGroup>
<columnGroup name="MeasurementName" height="21">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{MeasurementName}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementName}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents/>
</crosstabTotalColumnHeader>
</columnGroup>
<columnGroup name="UOMName" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{UOMName}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{UOMName}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents/>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="MeasurementValueMeasure" class="java.lang.String">
<measureExpression><![CDATA[$F{MeasurementValue}]]></measureExpression>
</measure>
<crosstabCell width="61" height="16">
<cellContents>
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField isBlankWhenNull="true">
<reportElement style="Crosstab Data Text" x="0" y="0" width="61" height="16"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="25" rowTotalGroup="Taken">
<cellContents backcolor="#005FB3" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="50" columnTotalGroup="MeasurementName">
<cellContents backcolor="#005FB3" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="Taken" columnTotalGroup="MeasurementName">
<cellContents backcolor="#005FB3" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="50" columnTotalGroup="UOMName">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="Taken" columnTotalGroup="UOMName">
<cellContents backcolor="#005FB3" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="25" rowTotalGroup="Taken1">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="Taken1" columnTotalGroup="MeasurementName">
<cellContents backcolor="#005FB3" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" forecolor="#FFFFFF"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="Taken1" columnTotalGroup="UOMName">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
</box>
<textField>
<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{MeasurementValueMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
</band>
</summary>
</jasperReport>
You can try these two solutions:-
1:- Try to maximize the band height of both bands by right clicking on the band.
2:- Second option is too use "Report Group" , you can add two report group for chart and crosstab, to add report group go to "Report Inspector" right click on the report and then select "Add Report Group".

Colour issue in generated xls file with JasperReports

I am using Spring and iReport to generate jasper reports in excel format. All is working fine but I am having a single issue that the background colour of my reports in iReport is grey, but I am getting purplish hue in my generated Excel file.
I am setting Create Custom Palette to true, still it is not having any effect.
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="Charges Applicable" pageWidth="792" pageHeight="612" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" >
<property name="net.sf.jasperreports.export.xls.white.page.background" value="false"/>
<subDataset name="Table Dataset 1" >
<parameter name="ContractId" class="java.lang.String"/>
<parameter name="VersionNo" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT S.TERM_COMMENTS FROM FCM_TX_TERMINATION_CHARGE_T S
WHERE S.CONTRACT_ID=$P{ContractId} AND S.VERSION_NO=$P{VersionNo}]]>
</queryString>
<field name="TERM_COMMENTS" class="java.lang.String"/>
</subDataset>
<parameter name="ContractId" class="java.lang.String"/>
<parameter name="VersionNo" class="java.lang.String"/>
<queryString>
<![CDATA[SELECT F.OFFSET_ABLE_AGAINST_SLA_FLAG SLA_PENALTY_APPLICABLE
FROM FCM_TX_BASIC_CONTRACT_DTLS_T F
WHERE F.CONTRACT_ID=$P{ContractId} AND F.VERSION_NO=$P{VersionNo}]]>
</queryString>
<field name="SLA_PENALTY_APPLICABLE" class="java.lang.String"/>
<summary>
<band height="120" splitType="Stretch">
<crosstab>
<reportElement x="0" y="0" width="352" height="30" />
<rowGroup name="SLA_PENALTY_APPLICABLE" width="200">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{SLA_PENALTY_APPLICABLE}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<textField>
<reportElement positionType="Float" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="200" height="30" backcolor="#C9D9E7" />
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Is SLA Penalty Applicable"]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents/>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="SLA_PENALTY_APPLICABLE1" height="0">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{SLA_PENALTY_APPLICABLE}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#F0F8FF" mode="Opaque">
<textField>
<reportElement x="0" y="0" width="0" height="0" />
<textFieldExpression><![CDATA[$V{SLA_PENALTY_APPLICABLE1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents/>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="SLA_PENALTY_APPLICABLEMeasure" class="java.lang.String">
<measureExpression><![CDATA[$F{SLA_PENALTY_APPLICABLE}]]></measureExpression>
</measure>
<crosstabCell width="100" height="30">
<cellContents>
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="100" height="30" />
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression><![CDATA[( $V{SLA_PENALTY_APPLICABLEMeasure}=="Y" ? "YES" : "NO" )]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="25" rowTotalGroup="SLA_PENALTY_APPLICABLE">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<textField>
<reportElement x="0" y="0" width="50" height="25" />
<textFieldExpression><![CDATA[$V{SLA_PENALTY_APPLICABLEMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="50" columnTotalGroup="SLA_PENALTY_APPLICABLE1">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<textField>
<reportElement x="0" y="0" width="50" height="25" />
<textFieldExpression><![CDATA[$V{SLA_PENALTY_APPLICABLEMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="SLA_PENALTY_APPLICABLE" columnTotalGroup="SLA_PENALTY_APPLICABLE1">
<cellContents backcolor="#BFE1FF" mode="Opaque">
<textField>
<reportElement x="0" y="0" width="50" height="25" />
<textFieldExpression><![CDATA[$V{SLA_PENALTY_APPLICABLEMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>
<componentElement>
<reportElement key="table" positionType="Float" x="0" y="60" width="180" height="60"/>
<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" >
<datasetParameter name="ContractId">
<datasetParameterExpression><![CDATA[$P{ContractId}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="VersionNo">
<datasetParameterExpression><![CDATA[$P{VersionNo}]]></datasetParameterExpression>
</datasetParameter>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="180" >
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement positionType="Float" mode="Opaque" x="0" y="0" width="180" height="30" backcolor="#C9D9E7" />
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Comments]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement positionType="Float" x="0" y="0" width="180" height="30" />
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{TERM_COMMENTS}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
<staticText>
<reportElement mode="Opaque" x="0" y="40" width="180" height="20" backcolor="#C9D9E7"/>
<textElement>
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Temination charges for convenience]]></text>
</staticText>
</band>
</summary>
</jasperReport>
Set the property net.sf.jasperreports.export.xls.white.page.background to true in the report jrxml.
i.e.
<property name="net.sf.jasperreports.export.xls.white.page.background" value="false" />
The cause of strange behaviour of drawing color text
The JRXlsExporter has some limitations of using colours.
The snippet from source code of net.sf.jasperreports.engine.export.JRXlsExporter (I took source code of JR 6.3.0 version in this sample)
public void exportText(JRPrintText textElement, JRExporterGridCell gridCell, int colIndex, int rowIndex) throws JRException {
JRStyledText styledText = getStyledText(textElement);
if (styledText == null) {
return;
}
short forecolor = getWorkbookColor(textElement.getForecolor()).getIndex();
TextAlignHolder textAlignHolder = getTextAlignHolder(textElement);
short horizontalAlignment = getHorizontalAlignment(textAlignHolder);
short verticalAlignment = getVerticalAlignment(textAlignHolder);
short rotation = getRotation(textAlignHolder);
short mode = backgroundMode;
short backcolor = whiteIndex;
if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null) {
mode = HSSFCellStyle.SOLID_FOREGROUND;
backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
}
The cause of using "wrong" colour is at getWorkbookColor(Color) method from the same class:
protected HSSFColor getWorkbookColor(Color awtColor) {
byte red = (byte)awtColor.getRed();
byte green = (byte)awtColor.getGreen();
byte blue = (byte)awtColor.getBlue();
HSSFColor color = null;
if (getCurrentConfiguration().isCreateCustomPalette()) {
try {
color = palette.findColor(red,green, blue) != null
? palette.findColor(red,green, blue)
: palette.addColor(red,green, blue);
} catch(Exception e) {
if(customColorIndex < MAX_COLOR_INDEX) {
palette.setColorAtIndex(customColorIndex, red, green, blue);
color = palette.getColor(customColorIndex++);
} else {
color = palette.findSimilarColor(red, green, blue);
}
}
}
return color == null ? getNearestColor(awtColor) : color;
}
The color is defined with help of getNearestColor(Color) method:
protected HSSFColor getNearestColor(Color awtColor) {
HSSFColor color = hssfColorsCache.get(awtColor);
if (color == null) {
int minDiff = Integer.MAX_VALUE;
for (Map.Entry<HSSFColor, short[]> hssfColorEntry : hssfColorsRgbs.entrySet()) {
HSSFColor crtColor = hssfColorEntry.getKey();
short[] rgb = hssfColorEntry.getValue();
int diff = Math.abs(rgb[0] - awtColor.getRed()) + Math.abs(rgb[1] - awtColor.getGreen()) + Math.abs(rgb[2] - awtColor.getBlue());
if (diff < minDiff) {
minDiff = diff;
color = crtColor;
}
}
hssfColorsCache.put(awtColor, color);
}
return color;
}
If color (backcolor) of element is not present at supported colours list at org.apache.poi.hssf.util.HSSFColor class of Apache POI library the "nearest" color will be used.
For grey color (for example, #F2F2F2) the nearest color can be white. In this case JRXlsExporter will draw text with white backcolor ignoring original backcolor of textField element.
The JRXlsxExporter does not have this problem.
How to solve problem?
As we can see the getWorkbookColor method has this check:
if (getCurrentConfiguration().isCreateCustomPalette()) {
What if we can turn on custom pallette? Yes, this will solve our problem - in this case the original color will be applied.
We can enable custom pallete with help of net.sf.jasperreports.export.xls.create.custom.palette property or with help of Java API. The SimpleXlsExporterConfiguration.setCreateCustomPalette(Boolean) method will do the same stuff as net.sf.jasperreports.export.xls.create.custom.palette property.
Working example
I took colors of standard palette in Excel from HSSFColor class and prepared jrxml demonstrated which colors are supported by JRXlsExporter out of box.
<?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="All supported colours by JRXlsExporter" pageWidth="960" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="960" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" isIgnorePagination="true" >
<property name="net.sf.jasperreports.export.xls.create.custom.palette" value="true"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<title>
<band height="210">
<staticText>
<reportElement positionType="Float" mode="Opaque" x="0" y="10" width="960" height="25" forecolor="#000000" backcolor="#F2F2F2" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[All supported colours by JRXlsExporter]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="50" width="160" height="20" forecolor="#FFFFFF" backcolor="#000000" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[BLACK]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="70" width="160" height="20" forecolor="#FFFFFF" backcolor="#993300" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[BROWN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="90" width="160" height="20" forecolor="#FFFFFF" backcolor="#333300" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[OLIVE_GREEN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="110" width="160" height="20" forecolor="#FFFFFF" backcolor="#003300" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DARK_GREEN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="130" width="160" height="20" forecolor="#FFFFFF" backcolor="#003366" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DARK_TEAL]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="150" width="160" height="20" forecolor="#FFFFFF" backcolor="#000080" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DARK_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="170" width="160" height="20" forecolor="#FFFFFF" backcolor="#333399" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[INDIGO]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="0" y="190" width="160" height="20" forecolor="#FFFFFF" backcolor="#333333" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GREY_80_PERCENT]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="50" width="160" height="20" forecolor="#FFFFFF" backcolor="#FF6600" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[ORANGE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="70" width="160" height="20" forecolor="#FFFFFF" backcolor="#808000" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DARK_YELLOW]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="90" width="160" height="20" forecolor="#FFFFFF" backcolor="#008000" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GREEN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="110" width="160" height="20" forecolor="#FFFFFF" backcolor="#008080" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[TEAL]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="130" width="160" height="20" forecolor="#FFFFFF" backcolor="#0000FF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="150" width="160" height="20" forecolor="#FFFFFF" backcolor="#666699" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[BLUE_GREY]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="170" width="160" height="20" forecolor="#FFFFFF" backcolor="#808080" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GREY_50_PERCENT]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="160" y="190" width="160" height="20" forecolor="#FFFFFF" backcolor="#FF0000" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[RED]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="50" width="160" height="20" forecolor="#FFFFFF" backcolor="#FF9900" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIGHT_ORANGE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="70" width="160" height="20" forecolor="#FFFFFF" backcolor="#99CC00" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIME]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="90" width="160" height="20" forecolor="#FFFFFF" backcolor="#339966" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[SEA_GREEN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="110" width="160" height="20" forecolor="#FFFFFF" backcolor="#33CCCC" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[AQUA]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="130" width="160" height="20" forecolor="#FFFFFF" backcolor="#3366FF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIGHT_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="150" width="160" height="20" forecolor="#FFFFFF" backcolor="#800080" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[VIOLET]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="170" width="160" height="20" forecolor="#FFFFFF" backcolor="#969696" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GREY_40_PERCENT]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="320" y="190" width="160" height="20" forecolor="#FFFFFF" backcolor="#FF00FF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[PINK]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="50" width="160" height="20" forecolor="#FFFFFF" backcolor="#FFCC00" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GOLD]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="70" width="160" height="20" forecolor="#000000" backcolor="#FFFF00" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[YELLOW]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="90" width="160" height="20" forecolor="#000000" backcolor="#00FF00" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[BRIGHT_GREEN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="110" width="160" height="20" forecolor="#000000" backcolor="#00FFFF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[TURQUOISE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="130" width="160" height="20" forecolor="#FFFFFF" backcolor="#800000" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[DARK_RED]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="150" width="160" height="20" forecolor="#FFFFFF" backcolor="#00CCFF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[SKY_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="170" width="160" height="20" forecolor="#FFFFFF" backcolor="#993366" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[PLUM]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="480" y="190" width="160" height="20" forecolor="#FFFFFF" backcolor="#C0C0C0" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[GREY_25_PERCENT]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="50" width="160" height="20" forecolor="#FFFFFF" backcolor="#FF99CC" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[ROSE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="70" width="160" height="20" forecolor="#000000" backcolor="#FFFF99" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIGHT_YELLOW]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="90" width="160" height="20" forecolor="#000000" backcolor="#CCFFCC" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIGHT_GREEN]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="110" width="160" height="20" forecolor="#000000" backcolor="#CCFFFF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIGHT_TURQUOISE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="130" width="160" height="20" forecolor="#000000" backcolor="#99CCFF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[PALE_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="150" width="160" height="20" forecolor="#FFFFFF" backcolor="#CC99FF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LAVENDER]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="170" width="160" height="20" forecolor="#000000" backcolor="#FFFFFF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[WHITE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="640" y="190" width="160" height="20" forecolor="#FFFFFF" backcolor="#9999FF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[CORNFLOWER_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="50" width="160" height="20" forecolor="#000000" backcolor="#FFFFCC" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LEMON_CHIFFON]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="70" width="160" height="20" forecolor="#FFFFFF" backcolor="#7F0000" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[MAROON]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="90" width="160" height="20" forecolor="#FFFFFF" backcolor="#660066" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[ORCHID]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="110" width="160" height="20" forecolor="#FFFFFF" backcolor="#FF8080" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[CORAL]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="130" width="160" height="20" forecolor="#FFFFFF" backcolor="#0066CC" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[ROYAL_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="150" width="160" height="20" forecolor="#000000" backcolor="#CCCCFF" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[LIGHT_CORNFLOWER_BLUE]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="800" y="170" width="160" height="20" forecolor="#000000" backcolor="#FFCC99" />
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<text><![CDATA[TAN]]></text>
</staticText>
</band>
</title>
</jasperReport>
At JSS (Jaspersoft Studio) the output result looks like this:
Without applying <property name="net.sf.jasperreports.export.xls.create.custom.palette" value="true"/> the generated xls file will be like this:
The textField with "All supported colours by JRXlsExporter" text has backcolor="#F2F2F2" attribute (this is grey color), but the text was generated without backcolor (color is white).
With custom pallete the generated result is:
As we can see applying custom palette has solved problem of JRXlsExporter.
If you have a parent report and a child report and you have set only in child, it will not work. Set the property in both parent and child report.

prevent repeating values in table

I have several subDatasets, most of the results I use with Charts and this (working) part:
<pieDataset>
<dataset incrementType="Group" incrementGroup="group_2113924770">
<datasetRun subDataset="data_2113924770" uuid="724d6473-dd5d-41c4-af6e-4c5b1d995416">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]>
</connectionExpression>
</datasetRun>
</dataset>
</pieDataset>
The SubDataset definitions looks like this:
<subDataset name="data_2113924770" uuid="4a29c5a4-cd0a-4078-8b88-6699c60cbe5e">
<queryString language="MongoDbQuery">
<![CDATA[{ collectionName: 'xxx',
findQuery : { xxx: 1234 },
sort: { geo.c: -1 }
}]]>
</queryString>
<field name="xxx" class="java.lang.Integer"/>
<field name="geo.c" class="java.lang.String"/>
<variable name="var_2113924770" class="java.lang.Integer" resetType="Group" resetGroup="group_2113924770" calculation="Count">
<variableExpression><![CDATA[$F{geo.c}]]></variableExpression>
</variable>
<filterExpression><![CDATA[$F{geo.c} != null]]></filterExpression>
<group name="group_2113924770">
<groupExpression><![CDATA[$F{geo.c}]]></groupExpression>
</group>
</subDataset>
This works well for charts (results actually get grouped). Now I want to display grouped geo.c data in a Table instead of a Chart but the output looks like this:
This is how my charts look using the same dataset:
I can't put <dataset incrementType="Group" incrementGroup="group_2113924770"> into tables, and the rows don't get grouped by Country.. I tried the "printRepeatedValues" option without success. I think here is the main problem.
The definition of the dataset in a table looks like:
<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="data_2113924770" uuid="8c9a7682-73d6-4c85-b37d-5333eb7806cb">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
On trying to put dataset into it, the following error appears:
Error loading the report template: invalid content beginning with "dataset" found, "datasetRun" exptected.
Question: How to avoid the repeating key values and have every country only once?
Table definition:
<group name="presentation_2113924770" isStartNewPage="true">
<groupExpression><![CDATA[null]]></groupExpression>
<groupHeader>
<band height="225">
<componentElement>
<reportElement uuid="59259048-375f-4d6e-8c64-803ed1d626e2" key="table 3" style="table 3" isPrintRepeatedValues="false" x="25" y="24" width="360" height="140" isRemoveLineWhenBlank="true"/>
<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="data_2113924770" uuid="3accd345-1640-4493-a8ae-d000f84ccfcd">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="90" uuid="de9563e1-11a3-4c60-80bd-5678a9232475">
<jr:tableHeader style="table 3_TH" height="30"/>
<jr:tableFooter style="table 3_TH" height="30"/>
<jr:columnHeader style="table 3_CH" height="30">
<staticText>
<reportElement uuid="91f39641-8c93-4cc0-92a9-01649f83991c" x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Country]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter style="table 3_CH" height="30"/>
<jr:detailCell style="table 3_TD" height="20">
<textField>
<reportElement uuid="f7e51c9f-7837-45de-b90a-daaa3c330c06" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{geo.c}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="9374f6e6-0dde-4699-bd4e-3479526babb4">
<jr:tableHeader style="table 3_TH" height="30"/>
<jr:tableFooter style="table 3_TH" height="30"/>
<jr:columnHeader style="table 3_CH" height="30">
<staticText>
<reportElement uuid="9e67b831-f794-4ead-ad33-fea93cc5ca63" x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Hits]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter style="table 3_CH" height="30"/>
<jr:detailCell style="table 3_TD" height="20">
<textField>
<reportElement uuid="e823f0ac-8c65-4bd9-b243-0a8335aacc4a" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$V{var_2113924770}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</groupHeader>
</group>
In your variable declaration you have "Count"-calculation:
<variable name="var_2113924770" class="java.lang.Integer" resetType="Group" resetGroup="group_2113924770" calculation="Count">
<variableExpression><![CDATA[$F{geo.c}]]></variableExpression>
</variable>
You should have "Sum". That will solve it for you, if I have understood your problem correctly.
Even the Crosstab element is looking more complicated, it has it's own aggregation and therefore works for my case. Tables do not work well with subDatasets.
This did the job perfectly:
<crosstab>
<reportElement uuid="d276ffa1-21e0-4ed8-8227-9655b60db25d" x="0" y="0" width="802" height="469"/>
<crosstabDataset>
<dataset>
<datasetRun subDataset="data_1825349606" uuid="c6e653d6-3eba-4064-a26e-c08d0f036b21">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
</dataset>
</crosstabDataset>
<rowGroup name="geo.c" width="334">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{geo.c}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents backcolor="#73B0E6" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textField>
<reportElement uuid="793c2a9e-5298-48c6-b15f-a1dd017bd781" style="Crosstab Data Text" x="0" y="0" width="70" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{geo.c}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents/>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="var_1825349606" height="30">
<bucket class="java.lang.Integer">
<bucketExpression><![CDATA["test"]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents backcolor="#73B0E6" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textField>
<reportElement uuid="751c32bf-7945-4532-a155-1ad1f533b559" style="Crosstab Data Text" x="0" y="0" width="144" height="30"/>
<textElement>
<font fontName="Verdana" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Hits"]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents/>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="geo.cMeasure" class="java.lang.Integer" calculation="Count">
<measureExpression><![CDATA[$F{geo.c}]]></measureExpression>
</measure>
<crosstabCell width="144" height="25">
<cellContents>
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textField>
<reportElement uuid="68daa770-9cc9-427f-a03a-9a614e585fb5" style="Crosstab Data Text" x="0" y="0" width="144" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{geo.cMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="25" rowTotalGroup="geo.c">
<cellContents backcolor="#CFDBE6" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textField>
<reportElement uuid="7a8a647f-84cd-4cff-84dc-bce867499f91" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{geo.cMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="50" columnTotalGroup="var_1825349606">
<cellContents backcolor="#CFDBE6" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textField>
<reportElement uuid="09274f02-3cc5-491e-922c-653f9a8908fe" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression><![CDATA[$V{geo.cMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell rowTotalGroup="geo.c" columnTotalGroup="var_1825349606">
<cellContents backcolor="#CFDBE6" mode="Opaque">
<box>
<pen lineWidth="0.5" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textField>
<reportElement uuid="2d2e463d-c66b-4575-a08d-42db590cd03d" style="Crosstab Data Text" x="0" y="0" width="50" height="25"/>
<textElement/>
<textFieldExpression> <![CDATA[$V{geo.cMeasure}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
</crosstab>

How can I set table colspan?

My question is that how I can set colspan value for a table footer column in iReport, in jrxml file.
I have to use iReport to create easily my PDF design. I send fields and parameters values from PHP via Tomcat. I don't use Java for create a dynamic jasper report.
That means I have to resolve my problem from jrxml.
Is it possible to make it?
You can't do a colspan as such but you can group the table columns in iReport (select more than 1 column in the table footer). Then remove the cells of the individual columns in the footer and add a cell for the "Group Header" in the footer.
All pure iReport/JRXML.
Detail part of xml:
<detail>
<band height="43" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="344" height="20"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{data_title}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement key="table" x="0" y="20" width="802" height="20"/>
<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="details">
<datasetParameter name="credit">
<datasetParameterExpression><![CDATA[$F{credit}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="debit_gross_sum">
<datasetParameterExpression><![CDATA[$F{debit_gross_sum}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="debit_net_sum">
<datasetParameterExpression><![CDATA[$F{debit_net_sum}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{details})]]></dataSourceExpression>
</datasetRun>
<jr:column width="12">
<jr:tableFooter height="15" rowSpan="1"/>
<jr:detailCell height="20" rowSpan="1"/>
</jr:column>
<jr:column width="48">
<jr:tableFooter height="15" rowSpan="1"/>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="48" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{time}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="106">
<jr:tableFooter height="15" rowSpan="1"/>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="106" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{description}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="130">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="130" height="15"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="130" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{guest_name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="48">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="48" height="15"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="48" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{room}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="79">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="79" height="15"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="79" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{cachier_user}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="77">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="77" height="15"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="77" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{source_room}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="126">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="126" height="15"/>
<box>
<bottomPen lineWidth="0.5"/>
</box>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[""]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="126" height="20"/>
<textElement>
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{source_guest_name}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="70">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="70" height="15"/>
<box rightPadding="0">
<topPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right">
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{debit_gross_sum}]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="70" height="20"/>
<textElement textAlignment="Right">
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{debit_gross}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="70">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="70" height="15"/>
<box rightPadding="0">
<topPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right">
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{debit_net_sum}]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="70" height="20"/>
<textElement textAlignment="Right">
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{debit_net}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="37">
<jr:tableFooter height="15" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="37" height="15"/>
<box>
<topPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top">
<font pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{credit}]]></textFieldExpression>
</textField>
</jr:tableFooter>
<jr:detailCell height="20" rowSpan="1"/>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
I would like to close up from tableFotter 3. cell 4 cells.
Thank you Alex K!