title: How to format data in cells of crosstab using measures of different types
body: <p>With regard to using crosstabs, is there a way to add any kind of formatting to the measures?</p>
  
  <p>I have the data as follows.</p>
  
  <p><a href="https://i.stack.imgur.com/y5cI8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y5cI8.jpg" alt="enter image description here"></a></p>
  
  <p>I need to display col2, col4 as per the formatting specified for any geographical location. For example, in India, we show the date as 11/11/1986 and number as 1,00,000. Another country may show the data as 11.11.1986 and number as 1.00.000</p>
  
  <p>How do I achieve this?</p>
  
  <p>Also, while creating the crosstab, I do not add any calculated function to the crosstab, yet, it takes up the highest values for that combination of row group and column group. Why is this? Here is the picture of the same</p>
  
  <p><a href="https://i.stack.imgur.com/f95Oz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f95Oz.jpg" alt="enter image description here"></a></p>
  
  <p>And the jrxml for the same is as below</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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="crosstabmeasure" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="e47b3f7d-1e00-4702-a900-be50a229f085"&gt;
      &lt;style name="Crosstab_CH" mode="Opaque" backcolor="#F0F8FF"&gt;
          &lt;box&gt;
              &lt;pen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;topPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;leftPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;bottomPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;rightPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;/box&gt;
      &lt;/style&gt;
      &lt;style name="Crosstab_CG" mode="Opaque" backcolor="#BFE1FF"&gt;
          &lt;box&gt;
              &lt;pen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;topPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;leftPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;bottomPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;rightPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;/box&gt;
      &lt;/style&gt;
      &lt;style name="Crosstab_CT" mode="Opaque" backcolor="#005FB3"&gt;
          &lt;box&gt;
              &lt;pen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;topPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;leftPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;bottomPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;rightPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;/box&gt;
      &lt;/style&gt;
      &lt;style name="Crosstab_CD" mode="Opaque" backcolor="#FFFFFF"&gt;
          &lt;box&gt;
              &lt;pen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;topPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;leftPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;bottomPen lineWidth="0.5" lineColor="#000000"/&gt;
              &lt;rightPen lineWidth="0.5" lineColor="#000000"/&gt;
          &lt;/box&gt;
      &lt;/style&gt;
      &lt;parameter name="Locale" class="java.lang.String"&gt;
          &lt;defaultValueExpression&gt;&lt;![CDATA["en-IN"]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;queryString&gt;
          &lt;![CDATA[select * from internatioinlization]]&gt;
      &lt;/queryString&gt;
      &lt;field name="col1" class="java.lang.String"/&gt;
      &lt;field name="col2" class="java.lang.Integer"/&gt;
      &lt;field name="col3" class="java.sql.Timestamp"/&gt;
      &lt;field name="col4" class="java.lang.String"/&gt;
      &lt;summary&gt;
          &lt;band height="211" splitType="Stretch"&gt;
              &lt;crosstab&gt;
                  &lt;reportElement x="0" y="0" width="555" height="211" uuid="6c5ccb8a-50fc-4158-b2ba-88d864aa1e43"/&gt;
                  &lt;rowGroup name="col11" width="60"&gt;
                      &lt;bucket class="java.lang.String"&gt;
                          &lt;bucketExpression&gt;&lt;![CDATA[$F{col1}]]&gt;&lt;/bucketExpression&gt;
                      &lt;/bucket&gt;
                      &lt;crosstabRowHeader&gt;
                          &lt;cellContents mode="Opaque" style="Crosstab_CH"&gt;
                              &lt;textField&gt;
                                  &lt;reportElement x="0" y="0" width="60" height="20" uuid="86c09a7f-46b5-4d2f-ba87-715f99d832a8"/&gt;
                                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{col11}]]&gt;&lt;/textFieldExpression&gt;
                              &lt;/textField&gt;
                          &lt;/cellContents&gt;
                      &lt;/crosstabRowHeader&gt;
                      &lt;crosstabTotalRowHeader&gt;
                          &lt;cellContents&gt;
                              &lt;staticText&gt;
                                  &lt;reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="94fca0ea-1572-4d42-85d9-b06f92c73b6e"/&gt;
                                  &lt;text&gt;&lt;![CDATA[Total col11]]&gt;&lt;/text&gt;
                              &lt;/staticText&gt;
                          &lt;/cellContents&gt;
                      &lt;/crosstabTotalRowHeader&gt;
                  &lt;/rowGroup&gt;
                  &lt;columnGroup name="col41" height="20"&gt;
                      &lt;bucket class="java.lang.String"&gt;
                          &lt;bucketExpression&gt;&lt;![CDATA[$F{col4}]]&gt;&lt;/bucketExpression&gt;
                      &lt;/bucket&gt;
                      &lt;crosstabColumnHeader&gt;
                          &lt;cellContents mode="Opaque" style="Crosstab_CH"&gt;
                              &lt;property name="com.jaspersoft.studio.unit.width" value="pixel"/&gt;
                              &lt;textField&gt;
                                  &lt;reportElement x="0" y="0" width="120" height="20" uuid="137ef406-6a2e-4629-9d38-4858c4a5ae2c"&gt;
                                      &lt;property name="com.jaspersoft.studio.unit.width" value="pixel"/&gt;
                                  &lt;/reportElement&gt;
                                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{col41}]]&gt;&lt;/textFieldExpression&gt;
                              &lt;/textField&gt;
                          &lt;/cellContents&gt;
                      &lt;/crosstabColumnHeader&gt;
                      &lt;crosstabTotalColumnHeader&gt;
                          &lt;cellContents&gt;
                              &lt;staticText&gt;
                                  &lt;reportElement x="0" y="0" width="-2147483648" height="-2147483648" uuid="5c71211d-f1db-4911-8923-2bdb208ddb99"/&gt;
                                  &lt;text&gt;&lt;![CDATA[Total col41]]&gt;&lt;/text&gt;
                              &lt;/staticText&gt;
                          &lt;/cellContents&gt;
                      &lt;/crosstabTotalColumnHeader&gt;
                  &lt;/columnGroup&gt;
                  &lt;measure name="col2_MEASURE1" class="java.lang.Integer"&gt;
                      &lt;measureExpression&gt;&lt;![CDATA[$F{col2}]]&gt;&lt;/measureExpression&gt;
                  &lt;/measure&gt;
                  &lt;measure name="col3_MEASURE1" class="java.sql.Timestamp"&gt;
                      &lt;measureExpression&gt;&lt;![CDATA[$F{col3}]]&gt;&lt;/measureExpression&gt;
                  &lt;/measure&gt;
                  &lt;crosstabCell width="120" height="20"&gt;
                      &lt;cellContents mode="Opaque" style="Crosstab_CD"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="60" height="20" uuid="861d0d3a-d774-4b0c-ae7d-ace315bf305c"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col2_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="60" y="0" width="60" height="20" uuid="163ed502-e753-444a-942d-832d84da0a5f"&gt;
                              &lt;/reportElement&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col3_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/cellContents&gt;
                  &lt;/crosstabCell&gt;
                  &lt;crosstabCell width="60" height="20" columnTotalGroup="col41"&gt;
                      &lt;cellContents mode="Opaque" style="Crosstab_CT"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="2576b9e2-3bba-40e3-aa15-5f4f0aada549"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col2_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="a111181f-b60f-4afd-8292-9e260c1b9ce2"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col3_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/cellContents&gt;
                  &lt;/crosstabCell&gt;
                  &lt;crosstabCell width="60" height="20" rowTotalGroup="col11"&gt;
                      &lt;cellContents mode="Opaque" style="Crosstab_CT"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="9adf6c9c-acee-4673-8b70-a376e7d1cbb4"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col2_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="9baedeed-4770-4153-b639-afc0965e9467"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col3_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/cellContents&gt;
                  &lt;/crosstabCell&gt;
                  &lt;crosstabCell width="60" height="20" rowTotalGroup="col11" columnTotalGroup="col41"&gt;
                      &lt;cellContents mode="Opaque" style="Crosstab_CT"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="60" height="10" forecolor="#FFFFFF" uuid="a2805e0a-080d-42be-ad86-a7e8e666f571"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col2_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="10" width="60" height="10" forecolor="#FFFFFF" uuid="c485f69d-91e1-4b19-a8ab-bdbfa3cafcc6"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$V{col3_MEASURE1}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/cellContents&gt;
                  &lt;/crosstabCell&gt;
              &lt;/crosstab&gt;
          &lt;/band&gt;
      &lt;/summary&gt;
  &lt;/jasperReport&gt;
  </code></pre>