Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Carrying multiple Sub Report data to Main Report

Posted on 2010-11-17
3
Medium Priority
?
452 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:GiaHughes
  • 2
3 Comments
 
LVL 35

Expert Comment

by:James0628
ID: 34163034
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
0
 

Author Comment

by:GiaHughes
ID: 34172994
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
0
 
LVL 35

Accepted Solution

by:
James0628 earned 2000 total points
ID: 34178758
In the WOLOCTotal formula in the subreport, you have

WOLocValue:= WOLocValue:= Sum ({PURREQ.TOTAL}, {@EQUIPLOCATION})

 That should be

WOLocValue := WOLocValue + Sum ({PURREQ.TOTAL}, {@EQUIPLOCATION})


 Replace the second := with +

 You can chain variable assignments: (var1 := var2 := 3) sets both var1 and var2 to 3.  In your case, you had the same variable name twice.  While that doesn't accomplish anything (it just sets the variable to the same value twice), it's legal syntax as far as CR is concerned.  That's why you didn't get an error.

 James
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question