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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharing variables from subreport group 2

Status
Not open for further replies.

steder

Technical User
Feb 16, 2003
6
US
Using v8.5

I have a subreport. This report is grouped by City.
I need to share the total number of devices per group (city)
to my main report.
Here's what I have:
In my subreport:

@ShareCountOfDevicesPerCity
shared numbervar countdevice := Count ({table.Vendor}, {table.CITY})

In Main report:
@SharedDeviceCity
shared numbervar countdevice;
Problem:
When I place the 1st formula of my subreport in the City group it totals correctly, but my main report formula shows ZERO.

When I place the 1st formula of my subreport in the Page Header, it passes the first groups total to the main report,
only.

I have grouped my city in my main report and need to use the shared variable, but as it changes with each group from the sub.

one suggestion was:
dgillz (Instructor) Feb 16, 2003
preface both formulas with the statement "WhilePrintingRecords;"

this did not seem to work,

Any Ideas?


Andy

(note: this was previously posted by a co-worker username steder)
 
Cant do this, I need the shared variable to use in calculations at each group level.

Andy
 
Right click the Group Header and select insert section below.

Place the subreport in the GH A.

Now you can use the shared variable anywhere below that, meaning GH B, details and the Group Footer.

So as long as you've linked the Main Report to the SUb on City, you'll get a fresh value for each City.

-k kai@informeddatadecisions.com
 
It works! sweeeeet.....
the last step I needed was to link the subreport to the group City.
I hid the subreport the best I could, I sized it down to a pin sized dot, and formatted the border color to white.
I don't know if this is right, but if I try to put it in a suppressed area, or try to suppress the formulas inside the subreport, my number goes to zero.
oh well, at least it cant be seen, and only can be found if the mouse is moved to the exact right spot..

Thanks, a ton!

Andy
 
You can suppress all the sections in the subreport, and it'll run fine. (Some leave the subreport report footer unsuppressed and make that section as thin as it can go, but I've never seen a need for this.)

If, in the main report, you suppress the section that the subreport is placed in, then the subreport will not execute.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top