How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Julio Your Own Question
Julio
Julio, Computer Software Engineer
Category: Computer
Satisfied Customers: 398
Experience:  Computer Engineer/ Software Troubleshooting
28896607
Type Your Computer Question Here...
Julio is online now
A new question is answered every 9 seconds

I am trying to set up a Crystal report with multivalue parameters.

Resolved Question:

I am trying to set up a Crystal report with multivalue parameters. I do not want the user to have to enter any values at all and to have the report interpret this as "ALL". I know how to evaluate the parameter to see if it is null, but I don't know how to build the selection formula so that if the parameter is null, then it selects all records (or doesn't evaluate that parameter at all). I cannot find info on this...
Submitted: 6 years ago.
Category: Computer
Expert:  Richard replied 6 years ago.

Hi there,

 

How about using an if statement in you selection formula for this?

 

 

Customer: replied 6 years ago.

I have tried using an if statement. Perhaps I am using it incorrectly in the selection formula. Could you give me an example? Say that my selection criteria are

A = 1

and

B = 2

and

insert if statement here

 

How would this work so that I could check to see if my parameter input is null and if so, select all vendors, if not only select the one on the list?

Expert:  Richard replied 6 years ago.

Hi there,

 

I think its best you look at the following link which demonstrates an example of using an if statement in a selection formula

 

Click Me

 

It is also a very good location for additional references

Customer: replied 6 years ago.
I thought you were supposed to give me an answer not tell me to find the answer myself. I don't use basic syntax in crystal. I also already know how to use if statements. What I tried to do is something like this but it doesn't work.

Selection formula:

A=1 and
B=1 and
If not isnull(?prompt) then C = (?prompt)

Can you give me an example crystal formula that will allow me to select all records if a parameter is passed a null? Do I have to write a stored procedure to handle this?
Expert:  Richard replied 6 years ago.

Hi there,

 

Ok, well what you need to do is conditionally make the select clause in the selection formula.

 

An example is

 

If a = null then

 

d.crystalreportviewer1.SelectionFormula = "{tblname.fieldname}"

 

else

 

d.crystalreportviewer1.SelectionFormula = "{tblname.fieldname}=VALUE"

 

end if

 

But if you do this repeatidly for a number of reports then it would be easier to use a stored procedure so that you can refer to that in all the reports and pass the nessesary value

 

 

 

 

Customer: replied 6 years ago.
Relist: Answer quality.
Expert:  Julio replied 6 years ago.
Hi,

Thanks for visit Justanswer.com
My name is XXXXX XXXXX I will try to help you solve your problem

On Report - Records - Selection formula use this formula
A=1 and B=1 and iif(isnull(?prompt),true,C=(?prompt))

Thanks
Julio, Computer Software Engineer
Category: Computer
Satisfied Customers: 398
Experience: Computer Engineer/ Software Troubleshooting
Julio and 7 other Computer Specialists are ready to help you

Related Computer Questions