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!

Report selection parameters with multiple values in 1 field CR XI

Status
Not open for further replies.

jeffr1

IS-IT--Management
Oct 16, 2005
9
AU
I have an <Include_text_variable> in <field> in a report selection formula and want to enhance it so a user can enter multiple include values separated by a comma on one parameter field selection screen at run-time.

Viz: where A, B or C in <Same_field>, or just A in <Same_field> is entered in the parameter field at run-time.

Is this possible without adding additional parameters for possible values in the same field?

There might be no inclusions or exclusions or there might be an a few or each, but we want to avoid creating unnecessary parameters
 
I'm not clear why you wouldn't just check "allow multiple values" for the parameter. Say you had a parameter {?Region} where the user could select 'East', 'West', 'North', 'South' from a dropdown. The user could select multiple values in the prompt screen and move them to the right. Or if they enter custom values, they can be moved individually to the right for the same prompt.

You seem to want them to enter the values in one long string, so can you clarify what the advantages would be?

-LB
 
Hi,

Thanks LB.

We would like to enter the text to be searched with comma delimiters in the parameter report refresh screen when printing.

The reason a pick list wont work is that we want to search anywhere in the field for the string. It is a free-form text description field and the text could be anywhere or non-existant in the field. From what I can see, the pick list doenst allow for selecting in this way.

Is there some other way it can be done? I tried setting multiple values on the parameter setup but then had problems trying to setup an array in the record selection formula as the selectoin values and the number of values that might be searched are unknown until run time. Viz - they might want all records (which I thank you for answering on a diff post) or just records containing "ABC" or "HIJ" or "XYZ" or just "DEF"

Is there some other way it can be done?
 
Allow the multiple values in the parameter and allow custom values.

When reading your records
Numbervar Paramcnt;
Paramcnt := Count(Parameterfield)

The above will tell you how many values were entered.

You will then have to check
Parameterfield [1] in Textfield
or
Paramcnt >=2 and Parameterfield [2] in Textfield
ect......

I hope you are not having hundreds of values.
 
I meant to get back to you earlier. You can also do it this way:

whilereadingrecords;
numbervar i;
numbervar j := ubound({?Parm});
stringvar array x;
for i := to j do (
if {table.text} like "*"+{?Parm}+"*" and
not({table.text} in x) then (
redim preserve x[j];
x := {table.text}
));
{table.text} in x

This would work as long as there were <= 1000 unique instances of the text field.

-LB
 
The values being checked might be part of a string of descriptive free form text so the pick list will not work as the text being searched could be anywhere in the field.

For example, the field might contain a descrition line "Meeting with John, Peter & Paul", or "Repair John's car".

We might want a report to select all transactions with "John" or "Peter" in that field or a report with any other value or values (Peter, John, Michelle, Dinner, Lunch", that could be anywhere in the field. The search items cannot be defined in a pick list as they are random and according to needs at the time.

We want to avoid setting up multiple parameters if posible for the same field, and were hoping to be able to have 1 report parameter and enter the search criteria in the single parametr field in a comma separated format "John, Peter, car" etc at report refresh time.
 
The last two suggestions ar not suggesting a picklist and are intended for searches of text fields. It does entail entering the keywords separately--which probably is more efficient overall, and still simple.

-LB
 
If you enter "JOHN" as a parameter
Parameter [1] in textfield means that if "JOHN" is anywhere in whatever field you have defined as the textfield if will be selected
Parameter [1] in TrxnDesc

The "LIKE" example works similar.

So if you enter multiple parameters
"JOHN"
"MARY"
JOHN is Parameter [1] and MARY is Parameter [2]
Parameters can be entered at run time of the report and changed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top