Solved

Carrying multiple Sub Report data to Main Report

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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