Home > Uncategorized > Taking care of Nan values in SSRS report

Taking care of Nan values in SSRS report

1. n Design view, right-click the design surface outside the border of the report and click Report Properties.

2. Click Code.

3. In Custom code, add following code

Public Shared Function Ratio(Num1 as double, Num2 as double) AS object

IF ISNOTHING(Num2) Or Num2 = 0 Then

Ratio = 0

ELSEIF Num1 = 0 THEN

Ratio = 0

ELSE

Ratio = Num1 / Num2

END IF

End Function

Change your queries like this.

=Code.Ratio(Fields!yourfield1.Value, Fields!yourfield2.Value)

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: