rcmpjames Posted May 24, 2007 Share Posted May 24, 2007 I am attempting to sum returned values in a Map from a subreport. I can get the value returned at the detail level, and get each corresponding value within the subreport displayed, but I need to sum them. When I attempt to put the value from the Map into a variable with sum as the calculation, it seems to be a step behind. ie: $V{returnMap}.get("totals") displays as 10 Variable set to the value of the retunr map with sum displays initially as null next returnmap:$V{returnMap}.get("totals") displays as 12 variable now shows 10 next returnmap:$V{returnMap}.get("totals") displays as 15 variable now shows 22 ...and so on - I need that first variable to show as 10, then the proper sums following I am displaying the variable(s) in group bands, evaluating at group level for the corresponding band. ...help? Link to comment Share on other sites More sharing options...
rcmpjames Posted May 24, 2007 Author Share Posted May 24, 2007 okay - reworking this. I get a map from a crosstab returned to a subreport, in turn sending that value to a main report. The problem: If I show the value from the map in a Text field, no problem - I can see it. However, I need to get that value into the main report - ie using a return variable. I need to sum these return variables on the main page in groups on the main report (which is why just forwarding the map does not solve my problem) So - when I try to populate a vairabel the same way the text field is populated, I get 0 - always. Here's the code: map: crossTabRowCountMap when I get the map into a text field:Code: <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Band" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="60" y="7" width="150" height="20" key="textField-4" positionType="FixRelativeToBottom"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{crossTabRowCountMap}.get("totals"«»)]]></textFieldExpression> </textField> When I try to get the values from the map into a variable: Code:[code] <variable name="districtTotalYes" class="java.lang.Integer" resetType="Group" resetGroup="District" calculation="System"> <variableExpression><![CDATA[$V{crossTabRowCountMap}.get("totals"«»)]]></variableExpression> <initialValueExpression><![CDATA[new java.lang.Integer(0)]]></initialValueExpression> </variable>Putting the above into a text field gives me 0. ...HEEEEELLLLLP....!!!! Post edited by: rcmpjames, at: 2007/05/24 16:48Post edited by: rcmpjames, at: 2007/05/24 16:49 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