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!

Multiple Codes to exclude

Status
Not open for further replies.

victora

Programmer
Feb 11, 2002
118
0
0
US
hello everybody:
I'm trying to create a report that will enable a user to enter code(s) to be excluded from the report. The number of codes is anywhere from 1 to 50 (length = 2 char) and it should be entered at runtime.

Parameter is out of the question because of the max # of possible codes.

Pls help...

Victora

 
Why is a parameter out of the question, is there a limit on the number of choices? as for string length there is a limit of 254 chars, 50 * 2 is only 100.
If you were to use a parameter you could use not in{parameter} in your record selection formula. Also what are they viewing the report through, if its through another program interface you could use a seprate screen to choose the codes to exclude.
I do similar things using csp and also vb.
 
Thanks for responding. I guess I have to mention that the number of codes is quite a bit. This code is on a field say, STAT_CD. Example of values in this field are: 1C, 1D, 2C, 3C, 4D, 8C...and so on. (50 codes in all)

The user should be able to enter these codes (maybe only 1 or 2 or 5 or 50) so they will be excluded from the report. If they choose to enter 50 codes, how will I grab every single one of them and use it on my selection 'Not equal to'. Will that mean I'll create 50 parameters?

I'm also a newbie on CR hence the ???ss

thanks
 
Step 1 - Create a multi-value parameter field.

Step 2 - in your record selection formula, exclude these values from your report as follows:

Not ({Fieldname} in {?MultiValueParameter}) Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Okay, I did exactly like what u said but heres what happened to my select formula:

before:
{MyTable1.Pay_Stat} = "Z" and
not ({MyTable2.Adj_Stat} in {?AdjustmentCodes})

save it and go back. Was changed to:
{MyTable1.Pay_Stat} = "Z" and
{MyTable2.Adj_Stat} <> {?AdjustmentCodes}

In this case, even if you enter multiple codes, it will use only the first code for comparison.

What am I missing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top