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

Supress Report Footer Issue 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

I have added a sub report into our PO document with T&C's.

I only want the report footer to show if a certain PO type is active for that PO type.

We have Type 1 , 2 and 4.

I don't want the Report footer to show if it is 4.

In the report footer section expert I have the Supress (Nor drill down) ticked and this formula in there

IF {PurchaseOrderHeader.OrderType} = 4 THEN False ELSE TRUE

I also have ticked under the tab Paging tab New Page Before, so it is on its own page at the end of the report.

For some reason it is not working and does not show anything no matter what PO number I put in.

Any ideas how I can fix the issue please.

Thanks
 
You have the formula backwards. I would just add this:

{table.type}=4

You can check what’s happening by placing the order type field in the report footer and observe it’s value. Another issue might be that the order type is sometimes null.

-LB
 
Thanks for the reply

I adjusted the code

IF {PurchaseOrderHeader.OrderType} = 2 THEN TRUE ELSE FALSE

But I am still not getting the last page with the T&C's
 
I don’t know why you did that. I thought you wanted it to show unless is was 4. So now you are telling it to suppress if it is 2. First step is to place the field in the report footer and then report back on the value that appears there.

Also, please explain whether the type can be null.

-LB
 
Hi

Sorry about that, we have 4 types of PO 1 to 4 and until tomorrow I cannot define which one shood not be used. So I was trying to get it working with just one type at least.

There may be nulls in the equation but there would be very few nowadays as it is a required field now. I am using just one PO number currently to get the last page working, and the PO is orderytpe 2.
I put the filed in the header and it is 2. Just no sub report with the text on the last page.

Thanks
 
Put it in the report footer where the subreport is. If the field can be null what do you want to happen when it is null? You would need to adjust the formula so that it operates correctly in the cases of nulls.

Again, your current formula will suppress the footer if the type = 2. If you want it to show, then change it to <>2.

-LB
 
HI

Moved it to the report footer and it is not showing the type number. I unticked the suppressed in section expert but still nothing showing.

If NULL then to show the last page.

Thanks
 
Write the formula like this—this assumes you want to SHOW the footer when the type is null or the type = 2. Since you appear to want to write this as an if/then, that’s what I’m doing:

If isnull({table.type}) or
{table.type}=2 then
False else true

Also, do NOT check the suppress box. The suppression formula will work without it, and when you Check it, it automatically suppresses when it encounters a null—that’s why you want to build it into your formula.

-LB

 
Hi

Brilliant, it is now showing the terms and conditions. However, and sorry about this, it is also showing the Page Header and Page Footers of the main report , this may be ok, but would there be away to exclude them if possible.

Thanks for the help
 
Since you have new page before set on the report footer, you can use a suppression formula for the page header and footer of:

Onlastrecord

Of course the page footer will still have some reserved space, but the content for the page footer will not appear.

-LB
 
Not quite working after all.

I now need to include two types of ordertpes 2 and 4.

Firstly is this code correct to supress the header on the last page? I am getting all sorts or results so just checking if the code is right.

IF PageNumber=TotalPageCount AND {PurchaseOrderHeader.OrderType} = 2 OR {PurchaseOrderHeader.OrderType} = 4 THEN True ELSE False


Secondly I then have this new issue but same report

In the Page Footer there is a @totalamount which is supressed using this formula. I think it as been created like this so any pages with more than one the @totalamount is left blank and the total amount is shown on the last page. My ordertypes to ignore and now numbers 4 and 2. The formula below works ok with a PO below with type 1

(PageNumber < (TotalPageCount - 1)) AND ({PurchaseOrderHeader.OrderType} = 4)
OR
(PageNumber < TotalPageCount) AND ({PurchaseOrderHeader.OrderType} <> 4)
 
You either need to add parens around the clause after “And”, as in:

(
{table.type}=2 or
{table.type}=4
)

Or change the clause to read:

And {table.type} in [2,4] then true else false

The last formula you mention will suppress the page footer if:

1) the type=4 and the page is any except the last two pages
2) the type<>4 and it is NOT the last page

I don’t understand what you mean by “ignore”. You need to say what you want to happen when the type = 2 and 4.

-LB

 
Thanks for the reply. I think I have it all working now except the following which I will try and explain better.

I believe the @totalamount is supressed unless it is the last page then show the @totalamount. The exception in this was ordetype = 4 which hten as the subreport t&C's as the last page. But now it also needs to include ordertpye 2, as both 4 and 2 now use sub report T&C's as the last page.

So if the ordertpye is 1 then @totalamount needs to show on the last page only and supressed on the other pages,
If the ordertype is 2 or 4 @totalamount needs to show on the page before the last page (which is the sub report with T&C).

ANy ideas would be welcome, many thanks

(PageNumber < (TotalPageCount - 1)) AND ({PurchaseOrderHeader.OrderType} = 4)
OR
(PageNumber < TotalPageCount) AND ({PurchaseOrderHeader.OrderType} <> 4)
 
(
Pagenumber < totalpagecount-1 and
{table.ordertype} in [2,4]
) or
(
Pagenumber < totalpagecount and
Not({table.ordertype}in[2,4])
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top