ihb1 Posted February 8, 2010 Share Posted February 8, 2010 Hi, 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> </reportElement> <box> <topPen lineWidth="0.25"/> <leftPen lineWidth="0.25"/> <bottomPen lineWidth="0.25"/> <rightPen lineWidth="0.25"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" lineSpacing="Single"/> <textFieldExpression class="java.lang.String"/> </textField> 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?..Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now