Skip to Content
author's profile photo Former Member
Former Member

Crystal Report Parameter Default Value

Hi All,

I have one issues regarding the parameter in the report.

I have two parameter field in the report. The scenario will be as below:

In my report, i have mobile no & passport no parameter selection. Currently in my report, the selection was like below:

{pax.mobile} = {?mobile} and

{pax.passport} = {?passport}

Formula above was placed in report's select expert. Each time user need to select or enter the two parameter above in order to select the entered data to be reflected into the report. However, my report REQUIRED to allowed null value from the parameter selection. I can enter mobile no but leave passport null, however with the formula above was unable to proceed to refresh the report. I have the formula as below, however it could not be able to work.

(if(hasValue({?mobile}) = true) then {pax.mobile} = '*ALL'

else {pax.mobile} = {?mobile} ) and

(if(hasValue({?patssport}) = true) then {pax.passport} = '*ALL'

else {pax.passport} = {?passport} )

The formula above will display all of the records and sometimes it will b hung.

Appreciated anyone who knows this able to advice.

Thanks.

Regards,

CK

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2010 at 10:26 AM

    I would have thought that if the parameter was Null then hasvalue() would return false

    Try

    
    (if(hasValue({?mobile}) = false) then true
    else {pax.mobile} = {?mobile} ) and 
    (if(hasValue({?patssport}) = false) then true 
    else {pax.passport} = {?passport} )
    
    

    Ian

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 03:27 PM

    I am having this same issue, but my parameter field is a date field.

    If the date parameter field is null then i would like to see all of the information, but if it has a date entered in the parameter field then i would like to see everything from that date on.

    Below is the formula that i have created.

    if(hasValue({?Start Date})=false) then true

    else {archsrsysclasstbl.START_DT} >= {?Start Date}

    When I execute the report and not enter a value for the date parameter the report will not execute because it is waiting for a value.

    How do i get it to select everything if the parameter is null.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.