I have added some Custom Code in Reporting Service.
Reports - Report Properties - Code Tab - Custom Code
Here is my code.
public Function Please(d as DateTime, CultureFormat as String) as
String
dim returnvalue as String
Try
System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo(CultureFormat)
dim ci as System.Globalization.CultureInfo
ci = new System.Globalization.CultureInfo(CultureFormat)
returnvalue = d.ToString("D",ci)
Catch ex As Exception
returnvalue = ex.ToString()
End Try
Return returnvalue
End Function
If I preview this report it works fine, but when I deploy this report,
I get this error message.
System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.SecurityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 failed.
at
System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean
ignoreGrants,
TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
at
System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet
grants, PermissionSet
denied, PermissionSet demands)
at System.Threading.Thread.set_CurrentCulture(CultureInfo value)
at CustomCodeProxy.Please(DateTime d, String CultureFormat)
Has anyone run into this before?
Thanks, JonThe code security permission do not allow you to set the current threads
culture. Since you are passing the culture info into the ToString method
you should not need to do this so I would just remove this line of code:
System.Threading.Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo(CultureFormat)
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
<jonknutsonhome@.yahoo.com> wrote in message
news:1126125095.372193.270750@.g14g2000cwa.googlegroups.com...
>I have added some Custom Code in Reporting Service.
> Reports - Report Properties - Code Tab - Custom Code
> Here is my code.
> public Function Please(d as DateTime, CultureFormat as String) as
> String
> dim returnvalue as String
> Try
> System.Threading.Thread.CurrentThread.CurrentCulture = new
> System.Globalization.CultureInfo(CultureFormat)
> dim ci as System.Globalization.CultureInfo
> ci = new System.Globalization.CultureInfo(CultureFormat)
> returnvalue = d.ToString("D",ci)
> Catch ex As Exception
> returnvalue = ex.ToString()
> End Try
> Return returnvalue
> End Function
>
> If I preview this report it works fine, but when I deploy this report,
> I get this error message.
>
> System.Security.SecurityException: Request for the permission of type
> System.Security.Permissions.SecurityPermission, mscorlib,
> Version=1.0.5000.0, Culture=neutral,
> PublicKeyToken=b77a5c561934e089 failed.
> at
> System.Security.CodeAccessSecurityEngine.CheckTokenBasedSetHelper(Boolean
> ignoreGrants,
> TokenBasedSet grants, TokenBasedSet denied, TokenBasedSet demands)
> at
> System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet
> grants, PermissionSet
> denied, PermissionSet demands)
> at System.Threading.Thread.set_CurrentCulture(CultureInfo value)
> at CustomCodeProxy.Please(DateTime d, String CultureFormat)
> Has anyone run into this before?
> Thanks, Jon
>
Showing posts with label properties. Show all posts
Showing posts with label properties. Show all posts
Friday, March 9, 2012
Saturday, February 25, 2012
Reporting Parameters with Jump to Report Action
I'm in Chart Properties > Data > Values > Edit.
Action tab > Jump to report > Parameters.
I want to jump to another report chart that is paramaterized. For "Parameter Value" I've already discovered you have to change the default "=Fields!xxx.Value" to "=Fields!xxx.UniqueName", but this only works if it is jumping to a single value parameter. I sometimes want to jump to multi-value parameter and don't know what expression should be. I want it to be something like "= included in Fields!xxx.BunchOfValues" but of course this option doesn't exist!
Any suggestions?
IN THIS CASE IN ORDER TO PASS MULTI VALUE PARAMETERS USE THE FOLLOWING SYNTAXJOIN(PARAMETERS!YOURPARAM.VALUE,",")
Subscribe to:
Posts (Atom)