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

suppress Page Header 1

Status
Not open for further replies.

swiss2007

Technical User
Aug 13, 2007
92
US
I am opening a new thread to explain everything clearly with example.
there is 1 date parameter, there is always 2 years of data.
I have 2 groups Country and Region.

I have the following structure.


PH Current Prior %Change YTDCurrent YTDPrior %ChangeYearly
Monthly

GH1a
GH1b Country
GH2 (Region)

GF2 Brussels $0.00 $4,333.30 -100.00% $6,839.40 $5,952.85 14.89%
BC $14,783.45 $14,967.29 -1.23% $15,223.58 $40,263.49 -62.19%
Greater London $659.70 $3,843.80 -82.84% $8,116.60 $11,017.32 -26.33%

and so on

Formulas:
currentmonth: if year({Orders.Order Date}) = 2005
and month({Orders.Order Date}) = month({?orderdate})
then {Orders.Order Amount} else 0

currentmonthsum: sum({@Currentmonth},{Customer.Region})

priormonth: if year({Orders.Order Date}) = 2004
and month({Orders.Order Date}) = month({?orderdate})
then {Orders.Order Amount} else 0

priormonthsum: sum({@Priormonth},{Customer.Region})

ytdcurrent: if year({Orders.Order Date}) = year({?OrderDate})
and
month({?OrderDate}) <= month({Orders.Order Date})
then {Orders.Order Amount}

ytdcurrentmonthsum: sum({@YTDCurrent},{Customer.Region})

ytdprior: if year({Orders.Order Date}) = year({?OrderDate})-1
and
month({Orders.Order Date}) <= month({?OrderDate})
then {Orders.Order Amount}

ytdpriorsum: sum({@YTDPrior},{Customer.Region})


trying to suppress regions which doesnt meet the following criteria

sum({@YTDPrior},{Customer.Region}) = 0
or
(sum({@YTDCurrent},{Customer.Region})-sum({@YTDPrior},{Customer.Region}) %
sum({@YTDPrior},{Customer.Region})) < 5 in the section expert

and suppress countries which doesnt have atleast 1 region.
using
in the sub, use a shared variable like this in the region group section (header or footer):

whileprintingrecords;
shared numbervar cnt;
if sum({@presentyr},{table.region})-sum({@previousyr},{table.region}) % sum({@previousyr},{table.region}) < 5 then
cnt := cnt else
cnt := cnt + 1;

In the country group header (still in the sub), use a reset formula like this:
whileprintingrecords;
shared numbervar cnt;
if not inrepeatedgroupheader then
cnt := 0;

In the country group footer, use:
whileprintingrecords;
shared numbervar cnt;

In the main report, go into the section expert->GH1_b (where your usual country group header fields are)->suppress->x+2 and enter:

whileprintingrecords;
shared numbervar cnt;
cnt = 0 //note no colon


So the thing finally I am trying to do is to suppress the pageheaders if the whole report doesnt meet any criteria
where sum({@presentyr},{table.region})-sum({@previousyr},{table.region}) % sum({@previousyr},{table.region}) < 5

Hope this is clear enough








 
I think you should just put the page header labels in a group header #1 section above the Country section, with the subreport in GH1a--so the sub will suppress the 'page headers', too. This should work if you have a page break before each Group #1. So:

GH1a: subreport
GH1b: header labels
GH1c: Group #1 fields

And you really didn't need to start a new thread.

-LB
 
Hi lb, it works but is there any way to show the group header fields only once at the top of the pag as there could be only 1 or 2 records per page and the rest of the page could be blank
I appreciate your help
 
I guess you could add a counter to the group header_b section:

whileprintingrecords;
numbervar cntb := cntb + 1;

Reset this in the page header with this formula:

whileprintingrecords;
numbervar cntb := 0;

Then use the following to suppress the GH1b:

whileprintingrecords;
numbervar cntb;
shared numbervar cnt;
cnt = 0 or
cntb <> 1

Not sure how the two factors will work together without testing.

-LB
 
I tried exactly the same but the Group headerb count is also counting
the excluded groups which do not meet the condition if I use the
formula.

whileprintingrecords;
numbervar cntb := cntb + 1;

so I tried to change and to avoid division by zero and placed the
following formula in th GH

if sum({@PriorMonth},{Customer.Region}) <> 0
and
((sum({@Currentmonth},{Customer.Region})-sum({@PriorMonth},{Customer.Region}))
/sum({@PriorMonth},{Customer.Region}))*100 > 5
then
numbervar cntb := cntb + 1;

but this formula is sometimes suppressing the GH and sometimes not
 
Hi lb finally made it with the help of your formula and group selection formula thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top