Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 What does IsNothing do?

Author  Topic 

mrm23
Posting Yak Master

198 Posts

Posted - 2008-08-04 : 03:51:26
Hi,
i want to know about Isnothing function.Also, let me explain the scenario where i am thinking to use it so that i can know if i am right.

I have two parameters in my report :
total_resources and billed resources.
These two are NOT coming from database and they are enterd by users.
Now based on whatever the user has entered, i must show one more row called "Utilization". That utilization will be :
billed_resources / total_resources.

Now, my problem is, since these data are NOT obtained from table,i must check for NULL and zerodivide error.
For zero divide error, i have used IIf statement in the expression.
but wht should i do if the user enters nothing? (Note that they both are not mandatory)
Will IsNothing be appropriate? if yes how?

Please help....its a bit urgent

Thanks in advance.....

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-04 : 14:16:58
use like this
=IIF(parameters!total_resources.value=0 OR parameters!total_resources.value Is Nothing,yourdefaultvalue,parameters!billed_resources.value /parameters!total_resources.value)
Go to Top of Page

mrm23
Posting Yak Master

198 Posts

Posted - 2008-08-05 : 01:04:31
hi,
Thanks for the reply
but how do i check for billed_resources?
i found one "orelse" built-in,some how made it work.
this i have used only to check for zero divide error. For handling null,i have given an expression in the visibility property of this field in the layout.
But tht doesnt seem to be a good choice as the field disappears when null is entered and the report doesnt appears good.
Is there any alternative?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-05 : 14:08:00
quote:
Originally posted by mrm23

hi,
Thanks for the reply
but how do i check for billed_resources?
i found one "orelse" built-in,some how made it work.
this i have used only to check for zero divide error. For handling null,i have given an expression in the visibility property of this field in the layout.
But tht doesnt seem to be a good choice as the field disappears when null is entered and the report doesnt appears good.
Is there any alternative?


what do you want to shoe when billed_resources is nothing?
Go to Top of Page

mrm23
Posting Yak Master

198 Posts

Posted - 2008-08-06 : 03:15:01
hi,
thanks for the reply.
when either of the total or billed resource is null, i want the utilization field to be left blank.
then only those two fields will be displayed.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-06 : 14:20:08
then use =IIF(parameters!total_resources.value Is Nothing OR parameters!total_resources.value Is Nothingm,"",Fields!utilization.value)
Go to Top of Page
   

- Advertisement -