| Author |
Message |
Becantor
Newbie
Joined: 28 Jul 2017
Online Status: Offline
Posts: 5
|

Topic: Hide Footer based on Report Section Posted: 08 Aug 2017 at 10:24am |
|
Have a scenario where there is a main report with an embedded sub report (which can be a varying lengths). Trying to find a way to NOT show the footer (page count) on the sub report pages and then continue again on the main report. I can't just use Suppress where PageCount=page number because the sub report could 1 page or 5 pages long.
Rough Outline of report is
Report Header
Page Header
Group 1
Details Aa
Details Ab
Details Ac (Sub Report)
Details Ad
Group 1
Page Footer.
Is there a way to have the footer suppress where the Report section equals Details Ac?
|
IP Logged |
|
Sastry
Moderator
Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
|

Posted: 08 Aug 2017 at 5:25pm |
|
Hi
Create a formula and place it in Details Ac where sub report prints on the main report like:
Flag = 'y'
Now create one more formula like :
Flag ='n' // Place this formula in Details Ad
Now right click on page count --Format-- suppress and say
If flag = 'y' then true else false
|
|
Thanks,
Sastry
|
IP Logged |
|
Becantor
Newbie
Joined: 28 Jul 2017
Online Status: Offline
Posts: 5
|

Posted: 09 Aug 2017 at 11:32am |
|
Thanks, but this doesn't seem to work.
Issue 1) When I create a formula and type " Flag='y' " and try to save, it says 'there is an error in the formula'.
So I went ahead and just saved the formula (@PageFlag_Yes) with simply " 'y' "
Did the same thing for the No flag
Issue 2) I went to the footer and said to suppress if {@PageFlag_Yes)='y'. Now it suppress the footer for All pages.
@Yes was placed on the Details Ac line (next to the sub report).
@No was placed on Details Ad section and hidden.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|

Posted: 10 Aug 2017 at 6:57am |
|
What Sastry didn't mention is that you need to create a variable to do this. So, your formulas would look something like this:
{@Flag_Yes}
stringvar flag := 'y';
' '
{@Flag_No}
stringvar flag := 'n';
' '
(the last line with the blank string is there so that noting appears on the report when you use this.)
Variables have to be declared in every formula where they're used. Using them like I show above, without any modifier (e.g., Local, Shared, Global) makes them Shared so that they will share values in all places in the "report" where they're declared (Main report OR subreport, but not between the two...)
Your suppression formula will then change to this:
stringvar flag;
flag = 'y'
You'll notice a couple of things here. In the first two formulas I used ":=" to set the value. When using variables, you use ":=" to set the value and "=" to compare. You'll also see I didn't use an "If..Then" structure here. If an expression evaluates to true or false, it is redundant to use "If .... then true else false", you can just use the expression itself.
-Dell
|
|
|
IP Logged |
|