Friday, March 30, 2012

Launching the Reports From Browser

Hi friends,

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

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

That DLL we have pasted in

D:\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 are giving the URL path as

http://localhost/ReportServer

But as per the SQL Server 2005 Reporting Services by Brian Larson we have pasted the following code into rssrvpolicy.config file

<CodeGroup

class ="UnionCodeGroup"

version="1"

PermissionSetName="Execution"

Name="WeatherWebServiceCodeGroup"

Description ="Code group for the Weather Web Service">

<IMembershipCondition Class ="UrlMembershipCodndion"

version ="1"

Url="http://localhost/ReportServer"/>

</CodeGroup>

and second code is

<CodeGroup

class="UnionCodeGroup"

version ="1"

PermissionSetName="FullTrust"

Name="MSSQLRSCodeGroup"

Description="Code group for the MS SQL RS Book Custom Assemblies">

<IMembershipCondition

class="StrongNameMembershipCondition"

version="1"

PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100B9F74F2D5B0AAD33AA619B00D7BB8B0F7678393A0F4CD586C9036D72455F8D1E85BF635C9FB1DA9817DD0F751DCEE77D9A47959E8728028B9B6CC7C25EB1E59CB3DE01BB516D46FC6AC6AF27AA6E71B65F6AB91B9576886F2EF39417F17B567AD200E151FC744C6DA72FF5882461E6CA786EB2997FA968302B7B2F24BDBFF7A5"/>

</CodeGroup>

so now we are checking the site

http://localhost/ReportServer

so we are getting following error

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'ReportingServicesWebServer, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

Source Error:

Line 27: <assemblies> Line 28: <clear /> Line 29: <add assembly="ReportingServicesWebServer" /> Line 30: </assemblies> Line 31: </compilation>


Source File: D:\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\web.config Line: 29


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

so where i am going wrong ?

can anyone help me out plz ?

anyhelp will be greatly appreciated

sandy

You have some typos in the first CodeGroup element:

<IMembershipCondition class ="UrlMembershipCondition"

You don't need this element anyway unless your DLL accesses a web service. In the second CodeGroup, it looks like PublicKeyBlob is copied from the book. Make sure that it matches the public key of your own assembly.

-Albert

|||

hi Albert,

thx for ur help. First that I did is I removed the following code

<CodeGroup

class ="UnionCodeGroup"

version="1"

PermissionSetName="Execution"

Name="WeatherWebServiceCodeGroup"

Description ="Code group for the Weather Web Service">

<IMembershipCondition Class ="UrlMembershipCodndion"

version ="1"

Url="http://localhost/ReportServer"/>

</CodeGroup>

so now I am not getting the configuration error.

Secondly whatever you said that I simply copied the Public Key Blob so now I have replaced it with my current DLL Public Key.

But Albert still I cant see the effect of my function on URL ie browser.

I can see the same effect on my Preview Tab but cant on Browser so where I am going wrong ?

--sandy

|||The easiest way for testing is to add the following:

<CodeGroup class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyCodeGroup2"
Description="Code group for my data processing extension">
<IMembershipCondition class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\[your assembly].dll"
/>
</CodeGroup>

just below the

<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="$CodeGen$/*"
/>
</CodeGroup>

entry.

If that works you can try to reduce the Permissions and try the Public Key-Stuff..
Have you looked at the logfiles? Sometimes you need to assert the permissions for other dlls that you have referenced..
|||

Hi binni,

The code which ur talking about , I have already incorported in my rsspolicy.config file.

Secondly I made sure that my current assembly is not using any other assembly also.

Then I checked all log file which are in

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

there also I didnt find any log file saying this problem.

Still I cant able to see the effect of my function on Browser.

-sandyee

|||

When you say you don't see the effect of your function, does that mean you see an error message? How do you know it is not working?

-Albert

|||

Hi Friends,

what we have done is that first of all we have stored all the values in one table like background color , forground colro , font size , font weight etc. Now in our function we are refering that table. And whatever values we have stored in the table that values function takes and set for the report. So when we are saying font size of 12 and when we apply that function to the Report Header , Report Header will be of font size 12 , and this effect we can see in Preview tab. But when see the report on browser Report Header is of font 8 only.

This I exactly mean by function not working,

Sandeep

|||

If the report is running and is not producing any errors, then either your code is not being called, or it's being called and not producing the correct result. Have you checked your code to make sure there are no problems? As a last resort you could try debugging the ASP.Net process.

-Albert

|||

Hi friends,

As my reports are working fine on Browser do I need to make any changes in any other configuartion file other that ReportServer config file (rssvpolicy.config)

for eg do I need to make any changes in Report Manager Config file (rsmgrpolicy.config) ?

-sandeep

|||

No, you do not need to make any changes in Report Manager config.

-Albert

|||To provide a solution for other people:
Maybe sandeep has forgotten the:
<Assembly: System.Security.AllowPartiallyTrustedCallers()> VB.NET
[Assembly: System.Security.AllowPartiallyTrustedCallers] C#.NET
for his assembly.

I got the same problem: my assembly just didn't work and the ReportServer-logfiles didn't contain any information of the error! Visual Studio 2005 showed the error, that my assembly doesn't allow partially trusted caller.
sql

No comments:

Post a Comment