Adding Custom Code To Reporting Services

  • Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/rVasant/2803.asp

  • Hi there,

    Nice article - I wasn't aware of the need to create objects to represent your classes - I had previously just went for the myClass.myFunction method and this seemed to find the classes successfully.

    I have previously managed to get a custom code DLL registered and working with a report designed in Report Designer.

    However, this was using single variables (mainly ints). What I am now attempting to do is pass in a comma delimited string of int values ("1,2,3") etc and I am encountering difficulties. I am using the same assembly as is already working and the code compiles in Report Designer, indicating that the report can find the method specified so I don't think it's a problem there.

    Is there a problem with the way I am supplying the data? I have set the comma delimited string as the source of a multi-value string parameter for use in a query.

    I only get "An error coccurred during local report processing. Error during processing of "myParameter" report Parameter".

    Any ideas would be most welcome.

    Thanks,

    Paul.

  • In Reporting services, the type-validation is not done. The values are converted implicitly.

    If you pass ("1,2,3") to an int parameter in the function, then it is considered as 123.

    If ("1,2,3") is passed as string, then it is considered as "1,2,3".

  • Why does the dll have to go in the PrivateAssemblies directory?

    And more importantly would that directory exist on a server with Reportin Services installed and not VS 2005?  I.E. how do I deploy the DLL?

    Thanks for the article,

    Mike

  • You can copy the DLL to the ReportServer bin directory, usually found here:

    C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin

    I've a feeling that the DLL may deploy itself to the ReportServer bin if your project is configured to deploy to the report server (at least my project took an awfully long time to build after adding the DLL as a reference) but I haven't tested this out.

     

  • When I initially tried to deploy the report it failed saying unable to locate the dll.  So I copied the dll to the location you specified and the deployment worked.  It did take longer to deploy this time like you said.

    Thanks for the post,

    Mike

  • Is it necessary that the dll has to be in the folder you specified onyl? What if the dll is given a strong name & placed in GAC?

    Will it work? I think copying in GAC is more efficient than copying at two different locations.

    Thanks,

    Tanmaya

  • I am not familiar with adding custom code or assemblies. Is it possible to modify the XML code at runtime? I want to control the report parameter properties multi-value setting of True/False during runtime. Set it to True if I want the parameters to be multi-value or single-value. This is determined based on the value selected in parameter one.

  • Thank you! Very helpful article and works perfect with .RDL. But how to make .RDLC work?

    I have installed VS 2008, reporting services 2005. Tried to copy my dll into C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin and

    C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

    (for some reason I do not have RSPreviewPolicy.config in C:\Program Files\Microsoft Visual Studio 9\Common7\IDE....

    then in my RSPreviewPolicy.config changed

    <PermissionSet

    class="NamedPermissionSet"

    version="1"

    Unrestricted="true"

    Name="SSRSAssemblyLibraryPermissionSet"

    Description="Allows access to SSRSAssembly Reporting resources">

    <IPermission class="SecurityPermission"

    version="1" Flags="Execution, Assertion" />

    and

    <CodeGroup

    class="UnionCodeGroup"

    version="1"

    PermissionSetName="SSRSAssemblyLibraryPermissionSet"

    Name="SSRSAssembly"

    Description="SSRSAssembly">

    <IMembershipCondition

    class="UrlMembershipCondition"

    version="1.0.0.0"

    url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\SSRSAssembly.dll"/>

    and it still does not work. What I made wrong?

    I really appreciated if anybody can help me. thanks

    An error occurred during local report processing.

    The definition of the report 'Main Report' is invalid.

    Error while loading code module: ‘SSRSAssembly, Version=3.0.0.1, Culture=neutral, PublicKeyToken=null’. Details: Could not load file or assembly 'SSRSAssembly, Version=3.0.0.1, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

  • Does anyone know if there is a limitaion to the amount of arguments that can be passed to a method in a custom assembly? I have quite a few (in order to do some calculations) fields that I have to pass in. When I try to preview the report, it says that there are too many arguments. I have verified that I am passing all the required fields to supply the method. It seems that there isn't any (that I have been able to find) documentation on the limitations of SSRS. I appreciate everyone's ideas!

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply