prevent repeating values in table - jasper-reports

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>

Related

Jasper report list element produces extra page

Here are some screen shots to demonstrate the problem:
First, here is the design with no list element:
And here is the result of that report (note that there are two pages):
Now if I add the list element, here is the design:
Here is the jrxml for the summary band:
<summary>
<band height="554">
<printWhenExpression><![CDATA[!$F{drawingRevision}.getPartsList().isEmpty() || !$F{drawingRevision}.getProcesses().isEmpty() || !$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
<staticText>
<reportElement positionType="Float" x="80" y="30" width="100" height="20" uuid="3210d220-35e0-4984-a00d-be4ad58feca4"/>
<text><![CDATA[Static Text]]></text>
</staticText>
<rectangle radius="5">
<reportElement x="0" y="0" width="284" height="16" backcolor="#E1E3FC" uuid="88870baf-afe8-4c0a-9b5f-fe88eb0f4dd3"/>
<graphicElement>
<pen lineWidth="0.0"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="5" y="0" width="113" height="16" uuid="9231dea5-26f2-40a8-8b45-2ce560e0f2ba"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Design Parameters]]></text>
</staticText>
<componentElement>
<reportElement x="0" y="16" width="284" height="13" uuid="12a8a577-6c77-4849-84c6-362544413192">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Parameters"/>
</reportElement>
<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="DrawingRevisionParameters" uuid="5ff517f3-e25b-4ed5-8589-33076f52c2c2">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getParameters())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="13" width="284">
<textField pattern="#,##0.####">
<reportElement x="0" y="0" width="50" height="12" uuid="9239498a-9b30-495f-a571-b505fceba75a"/>
<textElement textAlignment="Right">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterValue()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="54" y="0" width="72" height="12" uuid="f2c8d327-e8b4-4f5b-af0c-dad19c0fc4bb"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterUnit().getUnitAbbr()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="132" y="0" width="150" height="12" uuid="0e48fb28-af4b-4fac-8069-63bc1f880d80"/>
<textElement markup="rtf">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getSpecification().getSpecificationName()]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</summary>
And finally here is the result of that report.
Note that the floating "Static Text" label moved down appropriately, but not nearly enough to add an extra page to the report. However, you'll see that there are now 3 pages to the report anyway.
The only thing that changed was adding the list element. How can I make it so that it doesn't add the extra page? Or what am I not understanding with regard to lists? I could probably also pass the data into a sub-report so that the data is presented in the detail band of the sub-report, but I would much prefer to use a list if I could, since it seems much simpler to me. I am using version 6.6.0. Thanks!
Here is the full jrxml as requested (uuids removed to save on characters):
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Drawing" pageWidth="792" pageHeight="612" orientation="Landscape" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" whenResourceMissingType="Error">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<subDataset name="DrawingRevisionNotes">
<queryString>
<![CDATA[]]>
</queryString>
<field name="orderNum" class="java.lang.Integer">
<fieldDescription><![CDATA[orderNum]]></fieldDescription>
</field>
<field name="drawingNote" class="com.engineering.domain.drawings.DrawingNote">
<fieldDescription><![CDATA[drawingNote]]></fieldDescription>
</field>
</subDataset>
<subDataset name="DrawingApprovals">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="revisionID" class="java.lang.String">
<fieldDescription><![CDATA[revisionID]]></fieldDescription>
</field>
<field name="drafter" class="java.lang.String">
<fieldDescription><![CDATA[drafter]]></fieldDescription>
</field>
<field name="approver" class="java.lang.String">
<fieldDescription><![CDATA[approver]]></fieldDescription>
</field>
<field name="approvalDate" class="java.lang.String">
<fieldDescription><![CDATA[approvalDate]]></fieldDescription>
</field>
</subDataset>
<subDataset name="DrawingRevisionParameters">
<queryString>
<![CDATA[]]>
</queryString>
<field name="drawingParameterID" class="java.lang.Integer">
<fieldDescription><![CDATA[drawingParameterID]]></fieldDescription>
</field>
<field name="parameter" class="com.engineering.domain.drawings.DrawingParameter">
<fieldDescription><![CDATA[parameter]]></fieldDescription>
</field>
<field name="orderNum" class="java.lang.Integer">
<fieldDescription><![CDATA[orderNum]]></fieldDescription>
</field>
</subDataset>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["static/"]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[]]>
</queryString>
<field name="draftCount" class="java.lang.Integer">
<fieldDescription><![CDATA[draftCount]]></fieldDescription>
</field>
<field name="releaseType" class="com.engineering.domain.drawings.DrawingReleaseType">
<fieldDescription><![CDATA[releaseType]]></fieldDescription>
</field>
<field name="releaser" class="com.humanresources.domain.Employee">
<fieldDescription><![CDATA[releaser]]></fieldDescription>
</field>
<field name="releaseTimeStamp" class="java.time.LocalDateTime">
<fieldDescription><![CDATA[releaseTimeStamp]]></fieldDescription>
</field>
<field name="company" class="com.companies.domain.Company">
<fieldDescription><![CDATA[company]]></fieldDescription>
</field>
<field name="unitSystem" class="com.utilities.domain.units.UnitSystem">
<fieldDescription><![CDATA[unitSystem]]></fieldDescription>
</field>
<field name="drawingReleaseID" class="java.lang.Integer">
<fieldDescription><![CDATA[drawingReleaseID]]></fieldDescription>
</field>
<field name="fullDescription" class="java.lang.Boolean">
<fieldDescription><![CDATA[fullDescription]]></fieldDescription>
</field>
<field name="drawingRevision" class="com.engineering.domain.drawings.DrawingRevision">
<fieldDescription><![CDATA[drawingRevision]]></fieldDescription>
</field>
<background>
<band height="554" splitType="Stretch">
<rectangle radius="5">
<reportElement mode="Transparent" x="0" y="0" width="752" height="553"/>
</rectangle>
<frame>
<reportElement x="485" y="443" width="267" height="110">
<property name="ShowOutOfBoundContent" value="false"/>
</reportElement>
<rectangle radius="5">
<reportElement mode="Transparent" x="0" y="0" width="267" height="110"/>
<graphicElement>
<pen lineWidth="1.0"/>
</graphicElement>
</rectangle>
<subreport>
<reportElement x="0" y="0" width="180" height="34"/>
<subreportExpression><![CDATA[$P{SUBREPORT_DIR}+"HeaderSmall.jasper"]]></subreportExpression>
</subreport>
<line>
<reportElement x="0" y="35" width="180" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<staticText>
<reportElement x="39" y="36" width="21" height="7"/>
<textElement>
<font size="5"/>
</textElement>
<text><![CDATA[Title]]></text>
</staticText>
<textField>
<reportElement x="44" y="40" width="136" height="47"/>
<textElement verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getTitle()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="39" y="90" width="21" height="7"/>
<textElement>
<font size="5"/>
</textElement>
<text><![CDATA[Drawing]]></text>
</staticText>
<textField>
<reportElement x="44" y="94" width="136" height="16"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[String.format("%06d",$F{drawingRevision}.getDrawing().getDrawingID())+" Rev "+$F{drawingRevision}.getRevision().getRevisionID()]]></textFieldExpression>
</textField>
<line>
<reportElement x="38" y="36" width="1" height="74"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="180" y="0" width="1" height="110"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="39" y="89" width="141" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<frame>
<reportElement x="0" y="36" width="37" height="74"/>
<staticText>
<reportElement x="2" y="2" width="33" height="7"/>
<textElement textAlignment="Center">
<font size="5" isItalic="true" isUnderline="true"/>
</textElement>
<text><![CDATA[Tolerances]]></text>
</staticText>
<textField>
<reportElement x="2" y="9" width="33" height="20"/>
<textElement textAlignment="Center">
<font size="5" isItalic="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{unitSystem}.getUnitTolerance().getUnit().getUnitNamePlural()+"\nUnless\nNoted"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="2" y="29" width="33" height="33"/>
<textElement textAlignment="Center">
<font size="5" isItalic="true"/>
</textElement>
<textFieldExpression><![CDATA[($F{unitSystem}.getUnitTolerance().getTolerance3Place()!=null ? "X.XXX ±"+$F{unitSystem}.getUnitTolerance().getTolerance3Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getTolerance2Place()!=null ? "X.XX ±"+$F{unitSystem}.getUnitTolerance().getTolerance2Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getTolerance1Place()!=null ? "X.X ±"+$F{unitSystem}.getUnitTolerance().getTolerance1Place()+"\n" : "")+
($F{unitSystem}.getUnitTolerance().getFractional()!=null ? "Frac. ±"+$F{unitSystem}.getUnitTolerance().getFractional()+"\n" : "")+
"Ang. ±30'"]]></textFieldExpression>
</textField>
</frame>
<frame>
<reportElement x="180" y="0" width="87" height="109"/>
<componentElement>
<reportElement x="3" y="14" width="81" height="9">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Approvals"/>
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<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="DrawingApprovals">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getApprovals())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="9" width="81">
<textField>
<reportElement x="0" y="0" width="17" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{revisionID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="17" y="0" width="17" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{drafter}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="34" y="0" width="17" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{approver}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="51" y="0" width="30" height="9"/>
<textElement textAlignment="Center">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{approvalDate}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement x="3" y="3" width="17" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[REV]]></text>
</staticText>
<staticText>
<reportElement x="20" y="3" width="17" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<text><![CDATA[BY]]></text>
</staticText>
<staticText>
<reportElement x="37" y="3" width="17" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<text><![CDATA[APV]]></text>
</staticText>
<staticText>
<reportElement x="54" y="3" width="30" height="11">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<text><![CDATA[DATE]]></text>
</staticText>
<textField isStretchWithOverflow="true">
<reportElement x="3" y="14" width="81" height="0">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
</reportElement>
<textFieldExpression><![CDATA["PRELIMINARY REVISION "+$F{drawingRevision}.getRevision().getRevisionID()]]></textFieldExpression>
</textField>
<line>
<reportElement positionType="Float" x="3" y="17" width="82" height="1">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
</reportElement>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="true">
<reportElement positionType="Float" x="3" y="20" width="82" height="0">
<printWhenExpression><![CDATA[$F{drawingRevision}.getRevision().getRevisionType().getRevisionTypeID()!=1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA["REV BY APV DATE\n - "+$F{drawingRevision}.getDrafter().getInitials()]]></textFieldExpression>
</textField>
</frame>
</frame>
</band>
</background>
<detail>
<band height="554" splitType="Stretch">
<image scaleImage="RetainShape">
<reportElement x="5" y="5" width="742" height="548"/>
<imageExpression><![CDATA["\\\\SERVER\\Data\\Design Files\\Drawings\\ERP Draft Images\\"+String.format("%05d",$F{drawingRevision}.getDrawing().getDrawingID())+$F{drawingRevision}.getRevision().getRevisionID()+($F{draftCount}>1 ? "p"+$F{draftCount} : "")+".jpg"]]></imageExpression>
</image>
<componentElement>
<reportElement x="4" y="420" width="400" height="30">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Notes"/>
</reportElement>
<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="DrawingRevisionNotes">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getNotes())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30" width="400">
<staticText>
<reportElement x="0" y="0" width="48" height="14"/>
<text><![CDATA[NOTES]]></text>
</staticText>
<textField>
<reportElement x="0" y="14" width="15" height="14"/>
<textFieldExpression><![CDATA[$F{orderNum}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement x="16" y="14" width="384" height="14"/>
<textFieldExpression><![CDATA[$F{drawingNote}.getNoteText()]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
<frame>
<reportElement x="485" y="405" width="267" height="38">
<printWhenExpression><![CDATA[$F{drawingRevision}.getMaterial()!=null]]></printWhenExpression>
</reportElement>
<rectangle radius="5">
<reportElement x="0" y="0" width="267" height="38"/>
</rectangle>
<staticText>
<reportElement x="4" y="0" width="100" height="13"/>
<text><![CDATA[Material]]></text>
</staticText>
<line>
<reportElement x="4" y="12" width="259" height="1"/>
</line>
<staticText>
<reportElement x="138" y="0" width="61" height="13"/>
<text><![CDATA[Coating]]></text>
</staticText>
<staticText>
<reportElement x="199" y="0" width="64" height="13"/>
<text><![CDATA[Notes]]></text>
</staticText>
<textField>
<reportElement x="4" y="13" width="134" height="24"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialRaw().getShortDescriptionNoCondition() + ( $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition() == null || $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription() == null || $F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription().trim() == "" ? "" : ", "+$F{drawingRevision}.getMaterial().getMaterialRaw().getMaterialCondition().getConditionDescription() )]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="138" y="13" width="61" height="24"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialCoating()==null ? "" : $F{drawingRevision}.getMaterial().getMaterialCoating().getCoatingDescription()]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="199" y="13" width="64" height="24"/>
<textElement>
<font size="6"/>
</textElement>
<textFieldExpression><![CDATA[$F{drawingRevision}.getMaterial().getMaterialNotes()]]></textFieldExpression>
</textField>
</frame>
</band>
</detail>
<pageFooter>
<band height="12" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="418" height="12"/>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{releaseTimeStamp}+" Release ID: "+$F{drawingReleaseID}+" "+$F{company}.getCompanyName()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="430" y="0" width="257" height="12"/>
<textElement>
<font size="8"/>
</textElement>
<text><![CDATA[This proprietary drawing shall not be shared without written permission.]]></text>
</staticText>
<textField>
<reportElement x="687" y="0" width="50" height="12"/>
<textElement textAlignment="Right">
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="737" y="0" width="15" height="12"/>
<textElement>
<font size="7"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="554">
<printWhenExpression><![CDATA[!$F{drawingRevision}.getPartsList().isEmpty() || !$F{drawingRevision}.getProcesses().isEmpty() || !$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
<frame>
<reportElement x="467" y="1" width="284" height="318">
<printWhenExpression><![CDATA[!$F{drawingRevision}.getParameters().isEmpty()]]></printWhenExpression>
</reportElement>
<box>
<pen lineWidth="0.25"/>
</box>
<rectangle radius="5">
<reportElement x="0" y="0" width="284" height="16" backcolor="#E1E3FC"/>
<graphicElement>
<pen lineWidth="0.0"/>
</graphicElement>
</rectangle>
<staticText>
<reportElement x="5" y="0" width="113" height="16"/>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[Design Parameters]]></text>
</staticText>
<componentElement>
<reportElement x="0" y="16" width="284" height="13">
<property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Parameters"/>
</reportElement>
<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="DrawingRevisionParameters">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{drawingRevision}.getParameters())]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="13" width="284">
<textField pattern="#,##0.####">
<reportElement x="0" y="0" width="50" height="12"/>
<textElement textAlignment="Right">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterValue()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="54" y="0" width="72" height="12"/>
<textElement>
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getParameterUnit().getUnitAbbr()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="132" y="0" width="150" height="12"/>
<textElement markup="rtf">
<font size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{parameter}.getSpecification().getSpecificationName()]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</frame>
<staticText>
<reportElement positionType="Float" x="560" y="319" width="100" height="30"/>
<text><![CDATA[Static Text]]></text>
</staticText>
</band>
</summary>
</jasperReport>
I've encountered this before and the fixes I did was.
Check the size of the detail band and make sure that the list of values generated can all fit into the same page. Reduce the size of the detail band to see the difference.
Another is hide bands that are not in use or empty. For example try hiding the Summary band by setting it's Print When Expression to Boolean.FALSE.
You can also go to Report Properties > Check off Ignore Pagination Property

Freezing the crosstab header

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

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

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

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".

How to create Jasper Report Table component with Group By?

The standard column layout can use to achieve this. How can I do it for the table component layout?
It is quite easy. You should add new datasource for Table component and then use it (datasource) in this component.
The sample jrxml:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ... whenNoDataType="AllSectionsNoDetail" ...>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="tableDataset">
<queryString language="SQL">
<![CDATA[SELECT id, city, street FROM address ORDER BY city]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="CITY" class="java.lang.String"/>
<field name="STREET" class="java.lang.String"/>
<group name="CITY">
<groupExpression><![CDATA[$F{CITY}]]></groupExpression>
</group>
</subDataset>
<title>
<band height="58" splitType="Stretch">
<componentElement>
<reportElement key="table" style="table" x="0" y="0" width="299" height="46"/>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="tableDataset">
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
</datasetRun>
<jr:column width="90">
<jr:groupHeader groupName="CITY">
<jr:cell height="30" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<textFieldExpression><![CDATA[$F{CITY}]]></textFieldExpression>
</textField>
</jr:cell>
</jr:groupHeader>
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Id]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90">
<jr:columnHeader style="table_CH" height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="90" height="30"/>
<textElement/>
<text><![CDATA[Street]]></text>
</staticText>
</jr:columnHeader>
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField>
<reportElement x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{STREET}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</title>
</jasperReport>
The design in iReport looks like this:
The main report view:
The Table component view:
In this sample I've delete the main datasource and put the Table component to the Title band. I've set whenNoDataType="AllSectionsNoDetail" property for displaying report.
The data in report is grouped by city field.