[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

Use retured vars from subreports in running totals?

I have a var from my subreport and it's value is correct.

I need to Sum that var in group by totals as well as End of report.  

I can't seem to find out how to make a running total on that VAR or sum it.

This is a Warranty claims report.  Sub report has the pieces details and extended costs + labor.  Main report covers all the "reasons" for the claim.

I need to carry the total from this claim to the group by total line.  I can't seem to find out how?

This is Crystal for .NET  

TIA

__Stephen
0
srussell705
Asked:
srussell705
  • 5
  • 2
1 Solution
 
mlmccCommented:
You can use shared variables.

In the main report header create a formula
Name - DeclVars
Formula
 shared numbervar SubValue;

In the subreport add a formula probably in the detail section
Name - SetVars
Formula
 whileprintingrecords;
 shared numbervar SubValue;
 SubValue := {Field or Calculation};

You may then have to add another formula to do the totals rather than using summary or a running total.

mlmcc

0
 
mlmccCommented:
0
 
srussell705Author Commented:
Thanks for the link to what I used to push/pull the data to the main report.

I have the var @ClaimTotal captured in the main report already.  I see a value of 195.67 for this claim.

Now how do I create a running total on @CalimTotal so my group footers can say that for this model type my total claims are 1356.98?

Also need to see a total of all calims across model types at the end of the report.

0
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
mlmccCommented:
Probably through a formula like

 whileprintingrecords;
 shared numbervar SubValue;
{@ClaimTotal} + SubValue

Have to think about the grand total

mlmcc
0
 
PATKIRSCHCommented:
just a bit of further clarification (since it actually sounds like you want both group subtotals plus report grand totals? - this would actually call for 2 sets of running totals (and because you're using a shared variable, you won't be able to use the running total expert, so mlmmc's suggestions are dead on... only clarification owuld be for the "reset" formulas to add to get 1) the correct group subtotals and 2) a precaution to insure correct values upon report "refresh"  - i.e. often each running total requires 3 formulas:

1) to set the variable to zero
2) to compute the value (the formulas outlined above)
3) optional = to display the result (if you just want a single value visible vs. the actual running total accumulator details

so the additional formulas would be:
#1 = zero reset formulas:
                                   for the grand total                          for the group total
place in                          report header                                  group header
zero reset formula         whileprintingrecords;                         whileprintingrecords;
                                   variable declaration info/name-01;       variable declaration info/name-02;
                                   name-01 := 0                                     if inrepeatedgroupheader = true then name-02 := name -02
                                                                                            else name-02 := 0

#2 formulas = similar to the above... just be sure to use 2 different vairiable names so that each will accumulate separately

#3 = display formulas:
place in                        report footer                                     group footer
display formula             whileprintingrecords;                         whileprintingrecords;
                                   variable declaration info/name-01;       variable declaration info/name-02;
                                   name-01 := name-01                          name-02 := name-02






0
 
mlmccCommented:
PatKirsch {13778912}
0
 
mlmccCommented:
srussell705 -  How is that the answer to this question?

mlmcc
0
 
PATKIRSCHCommented:
yes, I'm confused also...
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now