Link to home
Start Free TrialLog in
Avatar of Gordon Hughes
Gordon HughesFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Carrying multiple Sub Report data to Main Report

I have a main report with 2 sub reports
I am carring data from the sub reports to the main report, using declared values, this is worrking for part of it, I cannot get this to work on the Group Footer # 1
Have attached the report and a screen shot showing the problem
Gordon
Purchases-to-Equipment-V4.rpt
Group-Footer-Sub-report-data.doc
Avatar of James0628
James0628

I see a couple of issues.

 Since the total is in GF1, it's presumably meant to be the total for group 1, but you set the variable (WOLocValue) to a new value in the "WO Costs" subreport in GH2b.  You set it to a new value, instead of accumulating the values from each subreport, so in GF1, WOLocValue will have the total from the subreport in the last GH2 in that group.

 Presumably @WOLOCTotal in the subreport should be changed from

shared numbervar WOLocValue;

if isnull (Sum ({PURREQ.TOTAL}, {@EQUIPLOCATION})) then WOLocValue:=0.00 else
WOLocValue:= Sum ({PURREQ.TOTAL}, {@EQUIPLOCATION})

   to

shared numbervar WOLocValue;

if not isnull (Sum ({PURREQ.TOTAL}, {@EQUIPLOCATION})) then
WOLocValue:= WOLocValue + Sum ({PURREQ.TOTAL}, {@EQUIPLOCATION})


 You also presumably need to reset WOLocValue to 0 for each new group 1.  The simplest thing would be to put a copy of @DecVal3 in GH1 (so it will be in the Report Header _and_ in GH1).


 You don't have those issues with the "Equipment Purchases" subreport, because you use that variable in GF2, instead of GF1.

 James
Avatar of Gordon Hughes

ASKER

Hi James

Thanks for the information
I have copied the decval3 in the GH1 of the main report and changed the @WOlocValue in the sub report
It gives a figure but it is not correct
Have attached another screen shot of the report together with an updated rpt file

Appreciate your support
Gordon
Group-Footer-Sub-report-data-Ver.doc
Purchases-to-Equipment-V4.rpt
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial