Count value not getting displayed for String colum


   I am trying to display the count of the number of rows above the current row. The column is of type String. I have set a formula expression using the propertyExpression element, as shown below:

            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
            <reportElement style="styleGroup" mode="Opaque" x="563" y="0" width="120" height="43">
   <propertyExpression name="net.sf.jasperreports.export.xls.formula"><![CDATA["COUNT(E1:E7)"]]></propertyExpression>
              <topPen lineWidth="0.25"/>
              <leftPen lineWidth="0.25"/>
              <bottomPen lineWidth="0.25"/>
              <rightPen lineWidth="0.25"/>
            <textElement textAlignment="Center" verticalAlignment="Middle" lineSpacing="Single"/>
            <textFieldExpression class="java.lang.String"/>

  I expect the value to be diaplyed as 7, as there are 7 rows above the current row.The problem is that the value is getting displayed as 0.  If I use the same expression for a column of type Integer or Double, the correct value is displayed. I need to mandatorily use the FORMULA attribute for this case and cannot use the Group_Count or other internal variables provided by Jasper. Is it mandatory for the column to be of type Integer or Double for the FORMULA attribute to display the value?..


ihb1's picture
Joined: Jan 28 2010 - 5:14am
Last seen: 13 years 8 months ago

0 Answers:

No answers yet