Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal XI sub-report shared currencyvar not returning value to main report

Posted on 2014-01-03
5
Medium Priority
?
1,137 Views
Last Modified: 2014-01-06
Main report contains the following @Material Costs formula:
IF ISNULL(Sum ({@Misc Costs}))
THEN {@PO Value}
ELSE IF ISNULL ({@PO Value})
THEN Sum ({@Misc Costs})
ELSE Sum ({@Misc Costs})+{@PO Value}

The formula @PO Value is simply...
shared currencyvar povalue

The Job Matl Sub-report contains the following formula:
@Value
{POReleases.Qty}*{PODet.UnitCost}

@SumPO
shared currencyvar povalue;
Sum ({@Value})

My main report formula @PO Value is supposed to pass the shared currencyvar povalue to the @Material Cost formula; however, I'm only getting the @Misc Cost... missing the Sum ({@Value}) from the Job Matl Sub-report.

Not certain what I'm missing?
Job-Cost-Actual-vs-Estimate.rpt
0
Comment
Question by:Lee Ingalls
[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
  • 2
5 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 1200 total points
ID: 39754805
The formula PO Value should never be null since the declaration of the variable initializes it to 0.

I would add a formula to the report header to declare povalue before the subreport is run.  This is more a style than a necessity.  The subreport then knows where the povalue variable is in the main report.

SInce the job cost subreport is in the report header it only runs 1 time not for each work center.  Is that the right place for it?

If you are trying to use the value from the other subreport (Job Matl) that is in the report footer then you need to move that subreport so it is run before the value is used in the subreport.

Crystal creates the report top down 1 section at a time.  Subreports are the last thing evaluated in a particular section.

mlmcc
0
 
LVL 9

Author Comment

by:Lee Ingalls
ID: 39755011
I placed a formula @poval in RHa, which declares shared currencyvar povalue.
I'm not concerned (for now) with the work centers, etc in (GH1). So long as their columns SUM to RFa to be used in @Total Labor.

RFa, contains:
     @Total Labor --> Sum ({@Labor})+Sum ({@Burden})
     @Material Costs simplified to --> Sum ({@Misc Costs})+{@PO Value}
     @Total Costs --> ({@Total Labor})+({@Materials Costs})

Where @Material Costs, @PO Value --> shared currencyvar povalue

I understand what you're saying about Crystal processing top down... and the Job Matl sub-report needing to run before it's value is needed in RFa's totals formula; so I saved the job material sub-report as Job Matl Subrpt2 and placed it in RFd and placed the original Job Matl Subrpt in RHb.

Unforntuately with the exact same results... @Material Costs is only picking up @MiscCosts values; still no value from shared currencyvar povalue.

My heads spinning.
Doc6.pdf
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39755171
Can you upload the report with some saved data?

mlmcc
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 800 total points
ID: 39755858
I didn't actually look at your report, but the SumPO formula in your first post is not actually setting the variable.

 You have:

shared currencyvar povalue;
Sum ({@Value})


 I am assuming that you want povalue to contain the total of the Value formula.

 To get the total from a single subreport, that should be:

shared currencyvar povalue;
povalue := Sum ({@Value})


 If the subreport is run more than once and you want to accumulate the total from all of the subreports in that variable, it would be:

shared currencyvar povalue;
povalue := povalue + Sum ({@Value})


 James
0
 
LVL 9

Author Closing Comment

by:Lee Ingalls
ID: 39759473
Once again EE proves it's value! Thank you mlmcc for the proper usage/placement of the shared currencyvar; and also to James0628 for pointing out I wasnt declaring the variable correctly. Both experts contributed to a successful solution.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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. …
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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