To display the value in cross tab you need to create a measure
Example
<measure name="myField" class="java.lang.String">
<measureExpression><![CDATA[$F{myField}]]></measureExpression>
</measure>
Note: the measure can be a simple representation of a field (as in example), with calculation="Nothing"
(default value if not indicated), remember to set correct class (same as field)
Now you can add the measure $V{myField}
to your crosstab cell:
<textField>
<reportElement style="Crosstab Data Text" x="0" y="12" width="50" height="12" uuid="2a004def-c91d-40be-ba2a-fac8763fca7b"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{myField}]]></textFieldExpression>
</textField>
As for you second question "Can I add several total row to my Cross tab"?, this is a bit unclear, you will get a total row as indicated by the totalPosition
attribute on the rowGroup
/columnGroup
and you can add as many group's as you like.
"Start" - totals are to be positioned before the other buckets.
"End" - totals are to be positioned at the end of the other buckets.
"None" - total are not required for this bucket.
Comment of OP:
To solve second problem I just created general rows in Column Header band. – Tomasz Iwaszko