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
gibneytAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
mlmccCommented:
Which formulas?

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

mlmcc
0
 
James0628Commented:
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
0
 
gibneytAuthor Commented:
Specifically, I need to understand the process to build the summary at the end.
NashuaTotalLaborDollars-v2008-nodata.rpt
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
James0628Commented:
Ah.  I think I misunderstood something.  In your first post you mentioned using WhilePrintingRecords and then "other formulas" and "order", and I thought you were asking whether formulas that did not use shared variables should use WhilePrintingRecords or WhileReadingRecords (or possibly neither).  That's what I was trying to answer in my previous post.  Sorry for any confusion.

 Are you having a problem with the totals in that report, or are you just trying to better understand how they're produced?

 FWIW, basically, formulas in the main report and subreport save each Cost Center in an array, and corresponding figures are saved in other arrays.  @xSetupTotals in the main report then converts the numeric figures for each Cost Center into strings (adding "$"s or "%"s), and stores those in string arrays.  The formulas at the end output the values in the arrays.

 James
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
gibneytAuthor Commented:
james,

Thanks for the information.

Tim
0
 
James0628Commented:
You're welcome.  Glad I could help.

 James
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.