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

Parameter not required, how to handle NULL 1

Status
Not open for further replies.

LT2

MIS
May 24, 2006
232
US
Hello,

Using CRXI r2 w/SQL Svr.

I've got a report that displays auths, tx codes, begindate, enddate and clients with a parms for dates created through a sql command. On the front end, I've got additional parms for Report Content, Sort by (uses @GroupName) and AgencyName with the Record Select:
Code:
({?AgencyName}='All' or {?AgencyName}='--Any Value--' or
{Command.Agency} = {?AgencyName})
The report works fine.

Until I created the last parm, {?ClientID}, static string, (None) for the value field, default = -Any Value- and set to allow custom and discrete values.

I then changed the Record Select:
Code:
(
{?ClientID} = '-Any Value-' and
  (
   {?AgencyName}='All' or
   {?AgencyName}='--Any Value--' or
   {Command.Agency}={?AgencyName}
   )
)
or
(
{Command.ClientID}={?ClientID} and
  (
   {?AgencyName}='All' or
   {?AgencyName}='--Any Value--' or
   {Command.Agency} = {?AgencyName}
  )
)

The idea, is for the end user to pick a client if they so choose or to get all client data for the other parameters they choose.

My guess is that Crystal is thinking it's dealing with a NULL and therefore doesn't know what to do.

Any ideas?
 
Hi,
Try with an If..Then..Else clause instead:
Code:
If {?ClientID} = '-Any Value-'
Then
 (
   {?AgencyName}='All' or
   {?AgencyName}='--Any Value--' or
   {Command.Agency}={?AgencyName}
   )

Else 
 
{Command.ClientID}={?ClientID} and
  (
   {?AgencyName}='All' or
   {?AgencyName}='--Any Value--' or
   {Command.Agency} = {?AgencyName}
  )

Should work and maybe easier to isolate any errors that may occur..




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks for the response Turkbear. Unfortunately, this did not fix my problem. I even added a dash for '--Any Value--' for the ClientID parm thinking it may be a quirk but this didn't help.

I did confirm that as soon as I changed the record select to
Code:
({?AgencyName}='All' or {?AgencyName}='--Any Value--' or
{Command.Agency} = {?AgencyName})
and the ClientID parm was eliminated, I did receive data.

Any other ideas?
LT
 
I found something interesting. I used your revised script. Recreated the {?ClientID} parm and posted to get the same results. When running the report, I typed in --Any Value-- in the ClientID parm and I got the data. And if I plug in an ID, I do get the required data as well.

How come, what I have set as the default in the parm, '--Any Value--', does not show once the report is posted for the end user, yet in my CRXI preview it is visible?

LT
 
Nevermind, I've figured that out too. I had to add --Any Value-- in the value section underneath the Actions with a description to Use when not searching on a clientid and now the default appears for the end user.

Thanks Turkbear for your time.
LT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top