Solved

Carrying multiple Sub Report data to Main Report

Posted on 2010-11-17
3
422 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 34

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 34

Accepted Solution

by:
James0628 earned 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now