cho Posted July 28, 2006 Share Posted July 28, 2006 I need to add the number of rows returned in last page of crosstab report. I tried various ways using the cross tab variables, but it is always returning the no. Of rows * no. columns. For ex. Columns are 30Rows are 52Report is returning 1560 instead of 52 at the end.This is very urgent. Can somebody help me? Link to comment Share on other sites More sharing options...
lucianc Posted July 28, 2006 Share Posted July 28, 2006 Could you clarify what are you trying to achieve? More specifically:- What do you mean by "number of rows returned"? I guess it's the number of rows in the crosstab, but does it include total rows or only detail rows?- Where exactly do you want to display this number ("last page of the crosstab report" is too vague)? Is it inside the crosstab (in the grand total row), or outside the crosstab (in the report)? Regards,Lucian Link to comment Share on other sites More sharing options...
cho Posted July 28, 2006 Author Share Posted July 28, 2006 Thanks for getting back quickly.I wanted the report in the format attached.I would like to show the count of rows(Employees) and count of columns(Days) at end of crosstab report. [file name=jasper_crosstab.doc size=26624]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/jasper_crosstab.doc[/file] Link to comment Share on other sites More sharing options...
lucianc Posted July 31, 2006 Share Posted July 31, 2006 I see that you want to show the number of crosstab rows and columns outside the crosstab. There is no straightforward way to do this, but it still can be achieved. For example, you can use a java.util.Map object to return these values from the crosstab. More specifically, you can do something like this:- create a java.util.Map variable "CrosstabReturnMap" having calculation="System" and new java.util.HashMap() as initialValueExpression- pass the map to the crosstab as a parameter:<crosstabParameter name="ReturnMap" class="java.util.Map"> <parameterValueExpression><![CDATA[$V{CrosstabReturnMap}]]></parameterValueExpression></crosstabParameter>- in the crosstab row and group headers, put the current row/column number in the map using a dummy expression: $P{ReturnMap}.put("Rows", $V{ROW_COUNT})- in the text element, extract the values from the map: $V{CrosstabReturnMap}.get("Rows"). Note that if the text element is placed on the same report band as the crosstab, you'll need to set evaluation="Band" HTH,Lucian 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