SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


GetClientIP Error - rsRuntimeErrorInExpression


GetClientIP Error - rsRuntimeErrorInExpression

Author
Message
yuvipoy
yuvipoy
Right there with Babe
Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)

Group: General Forum Members
Points: 792 Visits: 1386
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!
higgim
higgim
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1110 Visits: 2622
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
yuvipoy
yuvipoy
Right there with Babe
Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)Right there with Babe (792 reputation)

Group: General Forum Members
Points: 792 Visits: 1386
Thanks for the Link but it does not give the solution rather it is trying to address the problem but not fully.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search