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

PLS HELP! Passing shared variable still getting extra record

Status
Not open for further replies.

mwhalen

Programmer
Oct 31, 2000
217
CA
okay here is what I'm doing...

In my subreport my running total is in my footer. If running total above $500, then shared variable = display. In my main report - all my record info is in my footer while the subreport is in the header. I formatted the header to underlay the footer (details are suppressed) and I formatted the footer to suppress if shared variable <>display.

The proper totals are coming out for the proper records however I always seem to get the last line in my output such that the entire record is blank except for the subreport is showing my running total. Please help!

 
ahhh....I see your shared variable is a &quot;display flag&quot;

I assume it is reset to null before the subreport is run.

Why is the header underlaying the footer? Is there info that you always want to show?...Why don't you just display it in the footer and suppress the header altogether. Control individual fields (through conditional suppress) with the &quot;Shared Variable flag&quot;
 
Hi, thanks. I'm not sure where I would reset the display flag. I have it as a separate formula field on the same line in my subreport as my running total.

As far as returning the subreport to the header on the main and then underlaying, it's my understanding that it won't work any other way, i.e. the subreport where you are passing the shared variable must come before the rest of your record. If the display flag is false then I want the whole line of the record suppressed in the main report, not just the value but the entire line. Does this help? thanks.
 
Ok....getting there...the mud is a bit clearer

first of all....the &quot;display flag&quot; reset should be done in the subreport.....not in the main report...

create an &quot;initialize&quot; formula

and place it (suppressed) in the subReport report header

*************************************************
@Intialize

shared stringVar dispayflag := &quot;&quot;;
******************************************************

now you will get a consistent reset of the flag

Second....elininate the underlay....it does nothing for you as you describe it

Place the subreport in a section...all by itself...Make sure the subreport has all sections suppressed (I assume any relevant data is being passed back in other shared variables (BTW you can use that @initialize formula to reset their values too if needed). With the sections suppress there will be no display in the main report....in the main report format the subreport to have no borders....this way it will be totally invisible...

you cannot suppress the section with the subreport or it won't work (not even a conditional suppress)....so you are left with a gap in your main report when it prints.

This is not a problem though....just format the subreport as thin as you want(use Object Size and Position) to make it really thin.

To find it easily in design...set the background in the subreport to red in design mode. you do this by setting the check box red then in the conditional formula for this option type

If 1 = 1 then crNoColor else crRed;

when run it is no color but in design it is red

hope this helps

Jim

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top