Null report parameter

  • Hi all,

    Im having a bit of trouble with displaying a value in a text box when the parameter is null. Basically I have a text box with the following code

    =iif( Parameters!Status.Value=1,"For All Closed Jobs",iif(IsNull([Parameters!Status.Value]),"For All Jobs","For All Open Jobs"))

    IsNull does not seem to be a function as I get errors. Can someone please point me in the right direction.

     

    Thanks,

    Terry

  • Not sure about Reporting Services, but IsNull() as a T-SQL function takes two arguments:

    ISNULL (check_expression, replacement_value )

    So it might be worth starting there. Check BOL for more details.

    Regards

    Phil

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • This looks like Access code.  In Access you would use:

    nz([Parameters!Status.Value],"") = ""

    You could also use:

    [Parameters!Status.Value] = NULL

     

  • you can try this format :

    iif(isnull([Status]);"For All Jobs";iif([Status] = 1; "For All Closed Jobs";"For All Open Jobs"))

  • Terry,

    In Reporting Services you need to use IsDbNull.

  • Though VB and VBA don't handle nulls, if you are using Access VBA the solution is pretty simple. Just prepend a 0 to the NULL and then check for 0 (for ints). This is the easiest answer and works like a champ.

    'For an integer

    =iif( Parameters!Status.Value=1,"For All Closed Jobs",iif(cint("0" & [Parameters!Status.Value] ) = 0,"For All Jobs","For All Open Jobs"))

    'For a string

    =iif( Parameters!Status.Value=1,"For All Closed Jobs",iif([Parameters!Status.Value] & "" = "","For All Jobs","For All Open Jobs"))

  • Hi All,

    Thanks for the responses...but after much digging I found the solution to be as follows:

    iif( Parameters!FromDate.Value is nothing .....

    Im still cutting my teeth with designing reports in Visual Studio.Net.....Seems to me that normal everyday users who eventually want control of the report design process are DREAMING.

    Regards,

    Terry

  • Hi ,Hi

    Poor Developer Guy ,They are dreeming but to certain extent you can help them ,say for example adding filtering options to your report egeneration process.Better you see some ERP report screen.

    Enormous data will lead to disaster

    regards

    john

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply