2005 IR Help Posted August 26, 2006 Share Posted August 26, 2006 By: Jack Lavallet - jlavallet Problem summing multi subreport values 2004-07-15 20:31 Hi. I am using a subreport to calculate the summation of a field's values. This sum is passed to the master report using the 'tips and tricks' technique. I have verified that the subreport sum is correctly calculated and returned to the master report. The subreport is in my detail band and is run several times within the same group. I am attempting to use a variable to sum these returned sums in the master report. Here is my variable definition: <pre> <variable name="FunctionTotal" class="java.lang.Double" resetType="Group" resetGroup="FunctionGroup" calculation="Sum"> <variableExpression><![CDATA[$P{SubreportFunctionTotalMap}.get("SubreportFunctionTotal")]]></variableExpression> <initialValueExpression><![CDATA[new Double(0.00d)]]></initialValueExpression> </variable> </pre> Question: how can I get the subreport sum to be returned with each detail pass? It is currently evaluated after the group is completed. Question: how do I define a variable to sum each returned subreport sum for use in a textfield in the group footer. My report looks like this: <pre> Group Header Detail Band Start Subreport Start (subreport repeated for each subreport datasource tuple) Line 1 10 Line 2 20 Line 3 10 Subreport End (here's where I want to set my master report var to sum the value returned by the subreport) Detal Band End Column Footer Start Total 40 (the sum of the subreport sums) Column Footer End </pre> Thanks for your help! Jack <pre> Link to comment Share on other sites More sharing options...
eagle101 Posted November 13, 2006 Share Posted November 13, 2006 Do you ever get answer of your question? I am facing the similar problem and would like to figure out if there is a way to resolve it? I am in the verge of giving up on the iReport as solution due to this problem? Please help! 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