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

record selection statement

Status
Not open for further replies.

sondev

IS-IT--Management
Jan 7, 2005
22
I have a record selection statement that suggests...

txtClientCode={?txtClientCode}

This means that the parameter 'txtclientcode' is going to pull default clientcode for the report. I need to make an additional expression that suggests...

'if the clientcode is empty then show all clientcodes'. Where does this expression need to be inserted. I cant seem to enter it properly in the select expert. Please help

 
This is usually accomplished by giving the user the prepopulated default choice of "All", and then coding such as:

(
if {?txtClientCode} <> "All" then
txtClientCode={?txtClientCode}
else
if {?txtClientCode} = "All" then
true
)

Note that I intentionally use an Else If to aid in the SQL pass through.

-k
 
I was able to input the expression without any errors. I am unclear as to what you mean by prepopulated default choice of "All". How exactly do I prepopulate the value "ALL" to have all of my clientcodes. Thanks.
 
The problem is that I am still not able to get any result from the preview. It is a blank report. The report should either show one specified client. If no clientcodes are generated then it should show results for all codes by default.
 
Go to insert->parameter field->edit->set default values-> enter "All" (without the quotes) and click on the arrow to move it to the right. If you have already populated the list, then make sure that "All" is at the top by using the arrow key to move it there, if necessary. Now if you choose no parameter selection, all records should appear.

-LB
 
Lbass,

This statement was actually very helpful because it worked. And i appreciate your help. However, Ive learned that i cannot pre-populate the list because the data is consistently being updated in the database. Are there default commands that I can use to pull the data directly from txtClientCode
 
You can add "All" to the list without adding any other values. The user could then overwrite this with values they want to enter without using a prepopulated list. Otherwise, any default list you enter will be static and require updating. I think that the new CR 11.0 might make the parameter lists dynamic. You can also purchase other tools that will allow for dynamic picklists. I think Ido Millet offers one, or you can check Ken Hamady's site for other options.

-LB
 
I didn't understand the relationship between the can't prepopulate either, makes no sense, they're unrelated.

I think that you have 2 threads going here on this, but do as I/lb suggested and you should be fine.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top