SSRS – Reporting Services and custom assemblies

Just cost myself a few hours on this one.

I have recently installed the 2008 R2 Nov CTP, I also have RS reports that use a custom assembly.

(The custom assembly provides a Parameters class that returns a formatted string for the selected parameters on a page. We have staffID’s and client ID etc to identify people in our company, so you can type in a staff ID as a parameter to the report, or even a CSV list of staffID’s. The assembly will interogate the parameters, if it is a drop down it will interogate the webservices and find the display value for the selected value directly from the report definition, if it is a parameter of a given type – like staffID – it does a database lookup and returns a nicely formatted string that is rendered into a report. I am thinking of turning this into an assembly that anyone could purchase and making it configurable via xml… if there is interest?)

Anyway…

When it comes to writing and deploying custom assemblies you should read this;
http://bryantlikes.com/WritingCustomCodeInSQLServerReportingServices.aspx
Bryant is the man when it comes to this stuff

The thing was that my report was running successfully when I deployed it but not when running in BIDS – (Business Integration Development Studio).

I was getting this error

Failed to load expression host assembly. System.Security.Permissions.SecurityPermission

When you configure you assembly as per the instructions provided by bryant, you need to configure;

– rssrvpolicy.config, found generally in a location like D:Program FilesMicrosoft SQL ServerMSRS10_50.MSSQLSERVERReporting ServicesReportServer,
(this is the path for the NOV CTP on a x64 bit machine installed on D drive)

But there is also a corresponding policy file for BIDS to use and this also needs to be configured. It resides in the same folder as your IDEPrivateAssemblies where you copied you assembly for BIDS to work;
RSPreviewPolicy.config – D:Program Files (x86)Microsoft Visual Studio 9.0Common7IDEPrivateAssemblies

Updating this policy file fixed my issues.

Cheers
John

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.