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

record suppression based on a parameter

Status
Not open for further replies.

BJD

Technical User
Jun 22, 2001
27
US
I have the details section of a report suppressed based on the following formula:

IF {?NAME}='SCARLSON' THEN ({DESCRIPTION} STARTSWITH 'RPM')=FALSE ELSE IF {?NAME}='LINGLE' THEN ({DESCRIPTION} STARTSWITH 'BOBC' =FALSE
ELSE NO

So, for example, if the parameter entered is SCARLSON, then it is showing me any records whose DESCRIPTION field starts with 'RPM'. This is doing what I want, almost. I want records that start with something OTHER than 'RPM' or 'BOBC' to show all the time, regardless of what is entered for the parameter. Right now they do not show at all.
 
Try the following formula. It will suppress all "SCARLSON" unless the description starts with "RPM" or "BOBC"


=========================================================
WhilePrintingRecords;
booleanvar tf;

if {?NAME}="SCARLSON" then tf:=true;
if Description startswith ["RPM","BOBC"] then tf:=false;
tf
=========================================================

Mike
 
This does not show me any records that do NOT start with 'RPM' or 'BOBC' which is what I am having problems with.

For example, if a record's description starts with 'ABC' I do not want it suppressed, regardless of the ?NAME parameter entered.
 
Consider that this will pull every record in the table into the report before it's filtered.

If you use the Report->Edit Selection Formula->Record, you can filter them before they get into the report, which will speed things up dramatically.

In the record selection formula, use:

If {?NAME}='SCARLSON' THEN
not({DESCRIPTION} STARTSWITH 'RPM')
ELSE IF {?NAME}='LINGLE' THEN
not({DESCRIPTION} STARTSWITH 'BOBC')

If there's some reason why you want these rows in the report, then just use the same formula for the details section suppression.

-k
 
Use the descriptioin check first in an if then else

If description startswith ["RPM","BOBC"] then false else
The rest of you checks.

If the description part passes, the rest of the formula will be ignored.


Mike
 
Thanks for the responses. Filtering via the record selection gave me what I was looking for and is a much cleaner solution than what I had going.
 
Hello again
I have this record selection almost working. Now I am trying to select only records where the WORK_ORDER.USER_1 field starts with my ?PROMISE_DATE parameter OR the WORK_ORDER.USER_2 starts with ?PROMISE_DATE (see the end of the following formula):


(IF {?NAME} <> 'SCARLSON' THEN
NOT({PART.DESCRIPTION} STARTSWITH ['RPM', 'MPI'])

ELSE IF {?NAME} <> 'LINGLE' THEN
NOT({PART.DESCRIPTION} STARTSWITH 'BOBC'))

AND
({WORK_ORDER.USER_1} STARTSWITH {?PROMISE DATE}
OR
{WORK_ORDER.USER_2} STARTSWITH {?PROMISE DATE})



But it is only picking up records where the WORK_ORDER.USER_1 starts with the promise date parameter. It is like it doesn't see the OR clause.
 
Please supply an example of what's entered for {?PROMISE DATE}.

Try switching the user fields, does it only return the 2's now? I also tweaked your record selection formula a bit:

(
IF {?NAME} <> 'SCARLSON' THEN
NOT({PART.DESCRIPTION} STARTSWITH ['RPM', 'MPI']
ELSE IF {?NAME} <> 'LINGLE' THEN
NOT({PART.DESCRIPTION} STARTSWITH 'BOBC'))
)
AND
(
{WORK_ORDER.USER_2} startswith {?PROMISE DATE}
OR
{WORK_ORDER.USER_1} startswith {?PROMISE DATE}
)

-k
 
Yes, if I switch the order as you have in your example it only returns the USER_2 records. An example of an entry for ?PROMISE DATE would be '8/9/03 DK' so I am looking for records that start with 8/9/03, regardless of what text follows.
 
One more snag - I need to add another option to my ?NAME parameter (see the end of this portion of the formula) but it seems to ignore whatever I have after the first two.


(IF {?NAME} <> 'SCARLSON' THEN
NOT({PART.DESCRIPTION} STARTSWITH ['RPM','MPI'])

ELSE IF {?NAME} <> 'LINGLE' THEN
NOT({PART.DESCRIPTION} STARTSWITH 'BOBC')


ELSE IF {?NAME} <> 'DDM' THEN
NOT({PART.DESCRIPTION} STARTSWITH 'CAT'))

It is showing the records where the PART.DESCRIPTION starts with CAT regardless of what is entered as a ?NAME parameter

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top