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!

simple formula question

Status
Not open for further replies.

santosh1

Programmer
Apr 26, 2002
201
US
On page header, I have a formula field @SalesTaxExempt.

If OnFirstRecord then //First record
If {tpoPrintPOLineWrk.ItemID} = "800" OR Next({tpoPrintPOLineWrk.ItemID}) = "800" Then
"NO"
Else
"YES"

Else If OnLastRecord Then //Last record
If previous ({tpoPrintPOLineWrk.ItemID}) = "800" OR {tpoPrintPOLineWrk.ItemID}="800" Then
"NO"
Else
"YES"

Else If Previous({tpoPrintPOLineWrk.ItemID})="800" OR next({tpoPrintPOLineWrk.ItemID}) = "800" Then
"NO"
Else
"YES"

Depending upon the detail line item, I want to this field to display 'YES'(if itemID <>800)
or 'No' (if itemID = 800).

eg.
sales order: 1
Tax Exempt: YES

ItemID

1
2
3

sales order: 2
Tax Exempt: NO

ItemID

800
4
5

The above formula displays &quot;YES/NO&quot; correctly however, when there are multiple pages report for the same
sales order when there's lots of items, the formula works on individual page basis. i.e. If report page1
doesn't have item '800', then it displays YES, and if page 2 has item '800', the page 2 report header
displays 'NO'. How would I be able to fix this situation so that it will check the whole report (page 1 -
all) before deciding to print YES/NO on the page header exactly the same in all report pages. Thanks.

eg.

sales order: 3
Tax Exempt: NO

page 1

ItemID

9
4
2

page 2

ItemID

6
8
4

page 3

5
6
800
 
You could put a subreport in the header that scans through the itemids before you print the sales order.
 
Two possible answers.

If 800 is the largest value that your item Id can have (as in your example) then the easiest thing to check for is max({table.itemid}) = 800.

If not, create a formula @Taxable:

if {table.itemid} = 800 then 1 else 0

and place it in your detail section. then your check would be:

if sum({@Taxable}) = 0 then no else yes


Lisa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top