Friday, March 30, 2012

Launching Reports on Browser with Custom Assembly

Hi friends,

We have developed the Reports using SQL Server Reporting Services 2005.

In order to make our all reports dynamic we are refering DLL in all our reports.

That DLL we have pasted in

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

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

So when we observer the reports from Preview tab then we can see the effect of our DLL and all reports are working fine.

Now we want to launch all reports on browser so we have pasted the following code into rssrvpolicy.config file

<CodeGroup class="UnionCodeGroup"

version="1"

PermissionSetName="FullTrust"

Attributes="LevelFinal"

Name="Wizard_1"

Description="Codegroup generated by the .NET Configuration tool">

<IMembershipCondition class="StrongNameMembershipCondition"

version="1"

PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100DD11C5519C419099881AE462DC4D257CF2A1C126A3D06FEDFA1BF89A84993ADCC495032E92A1CB28A6400FE2D5667358155D6D35637DAB62CE95995B1FC66D23E2C0664AE8E2021BE66080DA0E5972C18B58E658470B82FC14D6E575EC8903367E16C16B168A90A6D8B20A9D9F91ED7CF95A45FA52435F76058D4F32807F9CF8"

AssemblyVersion="1.0.0.0"/>

and sencond code is

<CodeGroup class="UnionCodeGroup"

version="1"

PermissionSetName="FullTrust"

Name="MyNewCodeGroup"

Description="A special code group for my custom assembly.">

<IMembershipCondition

class="UrlMembershipCondition"

version="1"

Url="C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\ReportStyle.dll"/>

</CodeGroup>

so now we are checking the site

http://localhost/ReportServer

we can't see the effect of our DLL. So where excatly I am making mistake ?

This is now becoming very critical issue for our project so any help will be grately appreciated.

-- sandeep -

Hi,
I've a similar scenario right now. The problem seems to be the signing of the assembly!!! I don't know if this is one of MS great "it's not a bug, it's a feature"-Stuff, but try:
-DO NOT sign the assembly!
-delete the code-group with strongNameMembership (the first one) and only use the UrlMembership..
-have fun

@.MS: ReportServer does not throw any error, it just displays "#Error" if you use a method of a signed assembly in a textfield. If you run the report in local debug you get:
"Warning: Der Value-Ausdruck für das Textfeld-Objekt 'textbox1' enth?lt einen Fehler: Die Assembly l?sst keine Aufrufer zu, die nicht voll vertrauenswürdig sind. (rsRuntimeErrorInExpression)".
In english something like:
"Warning: The Value-Expression for textfield 'textbox1' contains an error: the assembly doesn't accept callers without fulltrust"


Benni

|||

Got it working?

edit:

After searching the internet I found what the error message means and that this is really rather a feature than a bug. So just add:
<Assembly: System.Security.AllowPartiallyTrustedCallers()> (VB)
[Assembly: System.Security.AllowPartiallyTrustedCallers] (C#)

to your signed Assembly..

But I think it's still a bug that the ReportServer doesn't write the cause of the error to the logfiles..


No comments:

Post a Comment