Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals from sub-report

Status
Not open for further replies.

BB45

Technical User
Feb 3, 2005
42
0
0
US
CR 10
SQL 2000

I am having difficulty getting the total from my sub-report to interact with the totals on my main report. I have done the following:

Added to sub-Report:

whileprintingrecords;
shared currencyvar TotalResidual;

shared currencyvar TotalResidual := Sum ({AH_accResidualByClient.ResidualBalance});

shared currencyvar TotalResidual;

Added to main report:

whileprintingrecords;
shared currencyvar TotalResidual;

and

Sum ({AH_accAgedAccountsReceivableByPrimaryClientAssignment;1.BalanceDue}) + {@TotalResVar}

The total of @TotalResVar is showing as zero in the footer of the report but it has a correct amount in the sub-report.

Any help would be great.

Thanks
BB
 
One thing to add. I have multiple sub-reports and varaibles being passed. One works two do not.

Thanks
BB
 
Please search on the subreport.There are lot of threads with the same problem.

It must be because you placed the sub value in the wrong section in the main.

For example if it's a summary at the group footer then you should create one more section and place it after the main.

I'm sorry if i'm not clear ,if you go through the threads you will understand.
 
Your subreport formula can look like this more simply:

whileprintingrecords;
shared currencyvar TotalResidual := Sum ({AH_accResidualByClient.ResidualBalance});

Then you must reference the variable in a section below the one in which your sub is located. If your sub is in RFa, then insert a RFb, and create a formula like this:

whileprintingrecords;
shared currencyvar TotalResidual;
Sum ({AH_accAgedAccountsReceivableByPrimaryClientAssignment;1.BalanceDue}) + TotalResidual

If this doesn't solve the issue, you must identify what section the sub is located in, and what section you are trying to reference the shared variable.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top