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

Suppress a field if parameter is not null? 1

Status
Not open for further replies.

wld1957

Technical User
Feb 3, 2006
68
0
6
US
Using CRXI - I want to try and set up a conditional expression to suppress a field if a parameter field is filled in. If the parameter field is empty I want to show the field.

Reason: Normal fields lengths are about 30 characters, most of the reports (70%) we are able to use the regular field in our software, but there are some names that can be up to 240 characters long. I want to be able to have the option of if they fill in the parameter field then the regular field that is also on the report will be suppressed, if they do not fill out the parameter field then the field will show on the report. I was trying the following without much luck. Any help would be appreciated.

Bill

If ({?Long Plaintiff}) IsNull
then ({cpmain.plaintiff})
else ({?Long Plaintiff})
 
close, try

If isnull({?Long Plaintiff})
then {cpmain.plaintiff}
else {?Long Plaintiff}
 
I tried what you had it comes back and states that the formula result must be a boolean. Both the field in the software and the parameter field are use for nothing but text to write out names or long names. I tried putting the formula on both the field in the report and on the parameter field with the same results.
 
You'll probably need:

If isnull({?Long Plaintiff})
or
trim({?Long Plaintiff}) = "" then
({cpmain.plaintiff})
else
({?Long Plaintiff})

Consider also creating a default value in the parameter, such as "use database field",then code for it:

if {?Long Plaintiff} = "use database field"
({cpmain.plaintiff})
else
({?Long Plaintiff})

Should improve the user experience.

-k
 
Thanks, I will give it a try tomorrow, I'm out of time today.
 
If you are trying to suppress the {cpmain.plaintiff} in the report when the parameter is selected you should be puttting this formula in the the formatting of this field.

You should right click the {cpmain.plaintiff}, select format field, select the common field and click the X-2 button to the right of suppress. Then type in

if isnull {?Long Plaintiff} or {?Long Plaintiff} = ""
then false
else
true.
 
Thanks RobbieB for the easy fix and thanks to all for the help. The placing of code in the parameter field is interesting and I will have to try and figure it out as it may prove to be useful for the future. My expierence with that area is limited and was not able to get it to work. I will conintue to work with it and try and learn. I'm problably just not setting it up correctly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top