Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summarizing Shared Var

Status
Not open for further replies.

nikki_c

Programmer
Aug 3, 2020
3
0
0
US
GH2 - Category
GH3 - Contract No
GH4 - Billing Item
GH5 - Project Phase

I have a subreport in the GH5a section pulling in estimated cost at the phase level. I created a shared var and placed it in the report footer. I then placed the shared var in the GH5b section of the main report. I can see the amount. But I can't do anything with it. I need to sum the phases estimate at the Billing Item level(GH4), the Contract No(GH3), and the Category(GH2). I think I need to create another variable that creates a total of the passed shared variable. But I do not know what I am doing.

In the image the purple are my passed shared variables. I left the subreport with a border so you can see where it is. I place yellow highlights where I need the purple to total.

SharedVar_Passing_gxikzw.jpg
 
So are you saying that you want the value from the sub-report to be passed back up to the beginning of the report? I am not sure if that is possible.
 
Yes. My report opens with all Categories summarized, then the user drills down to all the jobs...then the user drills to this area - giving him the items and phase codes within each one.
So the user group(executives) want the estimated totals(which feeds from the sub-report(boxed area) summarized in the group header areas as well.
I now pass the shared variable - but since I need to place them below - I am wondering how I can get the same format/layout/functionality.....

Thanks in advance.

I also seem to be having trouble with my passing of shared var on the division(group2) and Company(group1) level. But I am sure I am placing it wrong, or resetting something wrong, etc... So I am working on that.

But the formatting with using the shared is stumping me.
I almost wonder if I need to have a company level sub-report listing all and then pass the information below. But I would need to suppress the section and I didn't think you could do that either with a whileprintingrecords.
 
Well there is a trick with not suppressing sub-reports while really suppressing them. First off always remember that values from a sub-report are available in sections after the section the sub-report is in. Second to 'suppress' a sub-report. You create a sub-report where all the sections are suppressed. Then in the Format sub-report, Subreport tab, Choose 'Suppress Blank Subreport'. Then in the section the sub-report is in, Suppress Blank Section. Of course any shared variables will be passed via formulas.
 
I am still so confused.....
I can not figure out how to keep the format they want , and still pass all the variables.
 
I am not sure it is possible. I would have to do a lot of experimenting.
 
Try this on a renamed master report. Insert a GH2a section and place a copy of your current subreport saved under another name in GH2a. Remove all shared variable formulas from your original subreport in GH5 as that subreport will now just be for display. Link the GH2a subreport on the Grp1 and Grp2 fields. Pass the results from the sub to the GH2b section of the main report via shared variable. If you can insert groups in the GH2a subreport that mirror the ones in the main report, you could set up three kinds of shared variables, one for each group level in the main report. You of course would need reset formulas between groups, etc. If you can't set up the groups in the GH2a report, then you could insert another sub in each of newly inserted a sections of the other two groups. You will be able to make the reports disappear.

This is hard to explain without more detail about the report, etc., but this is worth a try I think.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top