Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Carrying multiple Sub Report data to Main Report

Posted on 2010-11-17
3
Medium Priority
?
440 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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. …
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

721 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