Link to home
Start Free TrialLog in
Avatar of gibneyt
gibneyt

asked on

Crystal Reports subreport sharing formulas

First off, mlmcc, thanks again for that intensive report.

I have some questions regarding the linking of the main report and the subreports and the programming used for the summary.

I know I have to create formulas using WhilePrintingRecords with Shared variables.  I can get that.  But in all the other formulas, what is the order or steps to come up with them?

TIA,

Tim
Avatar of Mike McCracken
Mike McCracken

Which formulas?

Can you attach the RPT file so others can reference during the discussion.  No data is needed.

mlmcc
FWIW, using shared variables automatically sets the evaluation time for a formula to the printing pass, so you don't have to specify WhilePrintingRecords when you use shared variables.  You can see that for yourself if you try using WhileReadingRecords in a formula with a shared variable.  If you have CR check the syntax, it should give you an error.

 It might be a good idea to include WhilePrintingRecords, as a reminder, but it's not necessary.

 As for other formulas, you normally want to be consistent and have all related formulas evaluated in the same pass, or you might not get the expected results.  For example, any formulas that are going to indirectly use the values from shared variables should also be evaluated during the printing pass, like if the value from a shared variable is added to a global variable in the main report, and then another formula outputs the total in that global variable at the end of the report.  The formula that outputs the global variable should also be evaluated in the printing pass.

 For other formulas that don't reference shared variables at all, it may not usually matter when they're evaluated, as long as it's consistent for any formulas that are related (using the same global variables).

 James
Avatar of gibneyt

ASKER

Specifically, I need to understand the process to build the summary at the end.
NashuaTotalLaborDollars-v2008-nodata.rpt
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gibneyt

ASKER

james,

Thanks for the information.

Tim
You're welcome.  Glad I could help.

 James