Deploying Custom assembly in SqlReport2000

Hello Experts,
Need urgent help.......
I created a custom assembly in vb.net

Imports System
Imports System.Security

Public Class CustomUserId
    Public Shared Function GetUserId() As String
        Dim sName As String = (Principal.WindowsIdentity.GetCurrent).Name
        sName = LTrim(sName)
        sName = RTrim(sName)
        Return LCase(sName)
        'Return "Test"
    End Function
End Class

I added the reference to this DLL in my report. Then I added textbox in my report. Added an expression:=CustomCodeHPCBM.CustomUserId.GetUserId()
Then Put the DLL in C:\Program Files\Microsoft SQL Server\80\Tools\Report Designer(on my local machine)
Then I previewed the report. It works fine.Textbox showed the userId.
Next I put the DLL in
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin(In the report server)
I deployed the report.Then when I start the report,Textbox shows #Error.

Any idea why this is happening?

justin11Asked:
Who is Participating?
 
ABaruhCommented:
what kind of permission?  Specifically, what are you trying to do?
0
 
ABaruhCommented:
It's probably a permissions setting

change the PermissionSet for Report_Expressions_Default_Permissions in
rssrvpolicy.config to FullTrust
0
 
justin11Author Commented:
Thanks,
Is it under configuration?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
ABaruhCommented:
Rssrvpolicy.config is in c:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer

Open it in notepad and do a search on the phrase Report_Expressions_Default_Permissions

The PermissionSetName should be FullTrust
0
 
justin11Author Commented:
Hello,
That worked...

But is there a way I can only give permission to this specific application instead of all the application
0
 
justin11Author Commented:
instead of setting the default permission to Full trust can I do something like this: I think this is for the specific report
right?

<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="MyCustomAssemblyCodeGroup"
Description="A special code group for my custom assembly.">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\Simple.dll"/>
</CodeGroup>            
0
 
ABaruhCommented:
yep, you can do that
0
 
justin11Author Commented:
What should I specify in class and name:

My project name is: CustomCodeHPCBM
Class Name is:CustomUserId
Method: GetUserId()
Will it be something like this:

<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="CustomCodeHPCBM"
Description="A special code group for my custom assembly.">
<IMembershipCondition
class="CustomUserId"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\CustomCodeHPCBM.dll"/>
</CodeGroup>  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.