Enhance Reporting Services By Including A Function Library

First we write a .Net function library called:

  • DirtyThings.Dll.

It contains "Public Class BodilyFunctions ...", and:

'BodilyFunctions' includes a Function called "Pick_Your_Nose_And_Eat_It"

Now let's get our Reporting Services Report to use the 'Pick_Your_Nose_And_Eat_It' function!

  1. Copy DirtyThings.Dll into the Report Designer folder on our machine. This ensures that "Preview" will work while you are developing the report.

    (The default location of the Report Designer is C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer)

  2. Copy DirtyThings.Dll onto the Server.

    It goes in the Report Directory Server, the default location of which is C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin.

  3. Tell your Report to use the DirtyThings.Dll.

    How do we do this?

    In your Reporting Services Report:

    1. Go to the Report Properties dialog (Report Menu | Report Properties, or right-click the background of the report layout and choose 'Properties')

    2. In the References tab: Click the ellipsis buttons next to the 'References' listbox(i.e., the button with three dots on it)

    3. Use 'Browse' to find the 'DirtyThings.Dll' file. Click OK.

    4. In the "Classes" list box, type "DirtyThings.BodilyFunctions" in the Class Name column. ('DirtyThings' is the namespace of our class, and bodily functions is the class we want to instantiate.)

    5. Put "oBodilyFunctions" in the "Instance Name" column, this is the object we'll be using in our expressions.

    6. Click OK and close the Report Properties dialog

  4. Now we can access our functions from any expression in the report, by typing:

    (Or in a more general sense: 'Code.{instance Name}.{function name}' )


Oh yeh, those boring losers at msdn have also written up how it's done, in their article Deploying a Custom Assembly

 

My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.