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!

Check if section is suppressed? 1

Status
Not open for further replies.

1tufgt

Programmer
Apr 11, 2020
34
0
0
US
Is there a method to check if a section in the report is suppressed? I have multiple subreports in multiple report sections and want to display a specific footer image (in page footer) depending on what section is displayed.
 
The only way I know is to check the same criteria that is being used to suppress the section.
 
That was my fear that was the case.
 
If a subreport is directly suppressed or if the section it is in is suppressed, the sub will not be able to pass a shared variable. So you could set up a shared variable in a subreport then make the page footer note appear only when the shared variable passes to it.

-LB
 
lbass, I'll give that a try and see what happens.
 
Ok that's not going to work with what my vision is.

It works for getting the page footer note to appear but it's appearing on every page but I only need it on Page A.

Example is:

Report Footer A - Subreport 1
Report Footer B - Subreport 2
Report Footer C - Subreport 3
Report Footer D - Subreport 4

Note 1: Report Footer A
Note 2: Report Footer B-D

Unless there is a trick to make the report footer in the Subreport always at the bottom and not dynamically flow with the content of the page.
 
Not quite clear on the issue. Is the subreport1 a multi-page report and you want a note at the bottom of each page? Let me know if this is the issue.

If you only need the note at the end of the aub, you could add a RF_b section for a faux page footer and then format the section to print at the bottom of the page, and then format it to new page after.

-LB
 
No the sub isn't a multipage subreport. I'm using suppression and using the shared value I get back to suppress or not.

Also I had a type in that Note 1 and 2 are in the "Page Footer" not report footer.

Problem I'm running into is that Note 1 is showing on subsequent pages since its suppression is set to true. I can't use "PageNumber" since the user can display any of the 4 pages they want.
 
You can create sets of formulas in the main report like the following, one set for each page footer section, identifying the flags for different subs with different letters:

{@trueA}:
Whileprintingrecords;
Booleanvar flagA := true;

{@falseA}:
Whileprintingrecords;
Booleanvar flagA := false;

Place {@falseA} (along with all other false formulas) in main report report header AND place {@falseA} in page footer_b. Place {@trueA} in pf_a where subreport A resides, and then format pf_a in the section expert to suppress with this formula:

Whileprintingrecords;
Booleanvar flagA;
FlagA = false //note no colon

Repeat for other page footer flags, putting the true formulas only in the section where the corresponding subreport resides. If you need to also use a shared variable because of conditional subreport suppression, then the suppression formula should read something like this:

Whileprintingrecords;
Booleanvar flagA;
Shared booleanvar suppresssubA;
SuppresssubA = false or
FlagA = false

-LB
 
Amazing logic lbass. That seemed to do the trick.
 
I tried to place the suppression on the image and not the page footer section and it isn't working since one image keeps on showing on the wrong pages.
 
The suppression formula should be on the section containing the image, not the image itself.

-LB
 
Please show the formula you are using to suppress the image.

Also, is it that you want the image to behave differently than the note in the page footer section? If so, in what way specifically?

-LB
 
Here's the suppression formula for the image.

Whileprintingrecords;
Booleanvar flagE;
flagE = False//note no colon

I used what you stated to use for the Page Footer on the image. I have the false formula in the Report Header and in the Page footer B which is after Page Footer A where the image is located.

The goal is that there is a different image for each sub report, so depending on which sub report in the Report Footer is displayed I need to display x image.
 
And {@trueE} is in PF_a?

I'm confused by your designation of the flag as FlagE--I was assuming you would designate the page footer flags with the letter that corresponds to the RF section the sub is in, e.g., flagA for RH_a and PH_a, etc.

You still haven't explained why you are not just using the suppression formula on the section in which the image is located.

-LB
 
Well i've restructured and have RF_a - F but I'm only using 1 Page Footer since using multiples seems to throw off my page formatting in the subreport.

I have:
RF_B
RF_C
RF_D
RF_E
RF_F

3 Images are located in PF_A.

Image 1: needs to display with RF_B, C & D
Image 2: RF_E
Image 3: RF_F

I've placed all the false formulas in the "Report Header" and placed the corresponding true formula's in the sections of the subreports.
 
You need separate page footers with the suppression formulas in the section expert, whether you are working with notes or images. The page footer should not be disrupting the display of the subreports if you are suppressing correctly. Note that the {@false formula should also appear in the section following the one containing the true formula, like this:

RH - {@falseA} {@falseB} {@falseC} {@falseD} //etc.
RF_a: subA {@trueA}
RF_b: subB {@falseA} {@trueB}
RF_c: subC {@falseB} {@trueC}
$F_d: subD. (@falseC} {@trueD}

The suppression formulas should be on the Pf sections in the section expert, not on the objects themselves.

-LB
 
So do I need a page footer for each report footer section or for each image? Example 5 page footer or 3 page footers?
 
I can't follow this anymore. Why are there 6 RFs if there are only 5 subreports? Is RFa used for something else? Are there still notes? Or only images? Please identify where all the subs are. Name the page footers to correspond with the subs they should appear with and then identify which subs also need images in the page footer.

If the image for a sub only appears when a corresponding note appears, they can be in the same Ph section. You can format objects in the section expert so that they don't overlap.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top