Hide Detail Section while still allowing WhilePrintingRecords to work with Variables, or How can I use Sum or create a Running Total of a Shared Variable

My report has a sub-report for Freight Hours using a formula as a lookup.  I get the hours, but need a Shared NumberVar so I can use the hours (which all works fine) and multiply by it's Unit Cost.

My main report needs to summarize the detail lines in a Group Footer using sum (without showing the detail lines which also contains the sub-report for the Freight Hours).  Since CR won't let you use Running Totals on Shared Variable I had to use create Formula Fields using WhilePrintingRecords for summing Freight Cost for the Item, Customer & Company (adding these to details section b with reset Formula Fields setting the Variable to 0 in its respective Header)

The problem is, if I hide or suppress the detail lines, WhilePrintingRecords will not evaluate so my Group sums correctly the Qty, Sale Price, Cost of Goods Sold, but shows the Freight Cost (the Sub-Report) as 0.  Therefore the Profit/Loss does not deduct the Freight Cost.

If I show all the details a, b, c, the report runs perfectly (but they only want to see the summary not every detail line)

Is there a way to hide the detail lines, but let CR calculate the Fromulas based on WhilePrintingRecords (I don't want to shrink the detail lines as some Items might have 50 detail lines others 1, so even minimal detail height will still make the report's look inconsistent)

Other than creating another Sub-Report to bring in the summary line, with a the current Sub-Report for the Freight Hours is there another way of getting the report to treat the Sub-Report value so that it can be summed or use Running Totals?
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.

Mike McCrackenSenior ConsultantCommented:
Yes.  Add another detail section and put the summing formula in it but have it return nothing (empty string)

You can then "hide" the section with the HIDE EMPTY SECTION option in the SECTION EXPERT.

lpiiAuthor Commented:
I am not following you in regards to "put the summing formula" in another details line.  Do you mean create a new formula that equals "", or are you referring to one of my summing formulas that I have already?
Mike McCrackenSenior ConsultantCommented:
Use the one you already have and add the '' as the last line so it doesn't display anything.

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

lpiiAuthor Commented:
I am still not quite following you.  If I have multiple sums, which would display a number, how would I turn it into a null by adding ''.  Are you saying I would need to add formulas for each sum to turn them into null, each detail line has it's own section expert, so I don't know how adding 1 extra detail line, adding a blank formula or somehow getting it to become null, how it will blank out Detail sections a, b, c (and the new section d)
Mike McCrackenSenior ConsultantCommented:
Can you upload the report so I can add the formulas for you so you can see how it is done
lpiiAuthor Commented:
I had to scrap that report previously and approach it from a different manner because I had to get it done, this report that I just made is a similar situation in that I need to hide the Group Header 3, but still have the Sub-Report create the shared var Qty_Paid in the function 1_Qty_Paid, so I can create not only display 1_Qty_Paid, but also use it in the formula 1_Delta (both in the details line)
lpiiAuthor Commented:
The last part of the sentence should read
so I can not only display 1_Qty_Paid, but also use it in the formula 1_Delta (both in the details line)
lpiiAuthor Commented:
I don't know if this would have worked in the original issue of details, but on the report I uploaded, I had to hide the Sub-Report detail line, in the Common Tab in section Expert in the Group Header, I had to Suppress the blanks sections (didn't work showed the Group Header 3 as a blank line) I then had to check off Underlay Following Section, why, I don't know, but I know have the report without blank lines.

There has to be a better way of passing values from a Sub-Report to the main report, allow the Sub-Report Shared Variable to calculate while hiding a line instead of all this extra work just to get blank lines or sections to not show up.  Very poor system of sharing variables.

Experts Exchange Solution brought to you by

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.