Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

Impact of Custom code in SSRS Report

$
0
0

HI Everyone,

for suppose, I have a situation where I have to divide 2 fields from the dataset and I should avoid divide by zero. for which I have 2 approaches.

1.written a custom code as below

Public Function getresult(denominator As Double, numerator as Double) As double
        If  denominator=0 Then
            Return 0
        Else
            Return numerator/denominator
        End If

    End Function

and added caluculated field having expression
=Code.getresult(Fields!numerator.Value,Fields!denominator.Value)

2 added a calculated field having expression
=iif(Fields!denominator.Value=0,0,Fields!numerator.Value/Fields!denominator.Value)

In this two scenario’s which is the optimized approach.(considering large data/ production server).

will vbcode impacts the performance of the report.

Thanks


Viewing all articles
Browse latest Browse all 20764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>