Adding "code" to SSRS Reports, I finally get it....
- Jason Davey
- Feb 13, 2019
- 1 min read
I finally figured out how and when to use the code portion of SSRS reports. Basically, we need to write code when there is not a default function available that serves our needs. In this instance, I created code named Divider. There is not a default SSRS function to determine if the divisor is a zero in SSRS. This code creates a function that allows us to pass two values to the code, and if the denominator is a zero, it returns zero.
If you try do do this as a regular math expression, SSRS will throw an error in your report. You can also create a complicated iff statement, but this is much more efficient, if you can understand how it works. This is the first instance I've found of using the code section in SSRS.
Recent Posts
See AllWe've all done it at some point. Accidently deleted documents from ProLaw, only to discover there is no undo button! Not fun. Luckily...