SSRS - Report level functions

When writing an SSRS report, it happens that formulas get a little too complicated or use logic that would be better if it was in a Function. This article describes how to write a report-level function in SSRS and call that function from a field expression

This example was written in Visual Studio 2008 against SQL 2008 R2

 

Related Articles

... and you 'll find more on the SQL Server Reporting Services Menu

In our example, we're going to create a function that handles division and also handles the dreaded 'divide by zero' error.

Start by going to the main menu and clicking on Report > Report Properties...

 

Next, go to the code window and write the funciton.

Last, open up an expression window for a field and use the new function. In this case we're dividing summary fields.


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences