Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

GetClientIP Error - rsRuntimeErrorInExpression Expand / Collapse
Author
Message
Posted Monday, February 17, 2014 5:16 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 5:29 AM
Points: 276, Visits: 910
To get the client ip followed the steps

1. Open the layout mode.
2. Click the menu “Report” -- > “Report Properties…”
3. Switch to “Reference” tab.
4. Click the top “Add” button, and then add the “System.Net”
5. After applying the follow steps, go to “Code” page, embed the following code:

Public Function GetClientIP() As String
Dim ipHost As System.Net.IPHostEntry
ipHost = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName())
Return ipHost.AddressList(0).ToString()
End Function

6. Now, in the report, use the following expression to get the value:
=Code.GetClientIP()

Reference :

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ff58b2fe-5fa7-4f2b-b36d-9685fc9f74fd/how-to-get-the-ipaddress-and-host-name-of-the-client-machine-on-which-reports-are-being-viewed?forum=sqlreportingservices


Error

Request for the permission of type 'System.Net.DnsPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (rsRuntimeErrorInExpression)

how to resolve the error.
DB : SQL server 2008
OS : Win 7 (32bit)

Thanks!
Post #1542054
Posted Wednesday, February 19, 2014 8:19 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 318, Visits: 1,067
Had a quick look and does the following link shed any light on your problem as a potential solution?

http://stackoverflow.com/questions/13076761/get-ip-address-of-user-client-viewing-report-in-ssrs-2008-report-manager
Post #1543053
Posted Friday, February 21, 2014 4:44 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 5:29 AM
Points: 276, Visits: 910
Thanks for the Link but it does not give the solution rather it is trying to address the problem but not fully.

Post #1543923
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse