Issue while using embedded vb code in SSRS 2005
HiProblem description: I am using the function to embedd within the report .This function is called the user presses the view reportbutton.It worksin the report designer (in preview),but it doesn't work on the server after i deployed it to the server,why does it give me the message that is Error during processing of '@ParameterName' report parameter.(rsReportParameterProcessingError).I am using Mgbox to display some alert statementsin the Custome code.. embedded into the.. reportdo I need to do anything with custom assemblies?or any other reasons this?Any help to solve this issue is greatly appreciated Regards,Kay
May 7th, 2009 7:00pm

Hi Kay, The MsgBox is a windows eventhandle not a web eventhandle. This function can work fine in Report Designer but not in the Report Server after deploy the report. You should use the Response.Write to alert the message using JavaScripti or VBScript. Here is a sample code for your reference: Public Shared Function GetColor(Byval param AS String) System.Web.HttpContext.Current.Response.Write("<script language='javascript'>alert('" & param &"');</script>") Return "Red" End Function For more information about how to add an assembly reference to a report, please see: http://msdn.microsoft.com/en-us/library/ms155974.aspx If you have any more questions, please feel free to ask. Thanks, Jin To use the samples code, you need to add the assembly System.Web reference to the report.
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2009 4:23am

hi Jin,Thanks for the reply.I tried your solution...This is my code Function CheckNum(NumEntered as Integer) as String System.Web.HttpContext.Current.Response.Write("<script language='javascript'>alert('" & NumEntered &"');</script>")Return "complete" End FunctionHowever... once i deployed the report on the server.. i get : Error during processing of IsValidNum report parameter. (rsReportParameterProcessingError) IsValidNum is the non-queried parameter where iamcalling =Code.CheckNum(3), When i comment out the code javascript part of the method... It returns the value "complete".... as expected... Please let me know if you have any other suggestions.. for this issue....
May 12th, 2009 10:05pm

Hi Kay, Please refer to the following threads: http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/7c147750-d1cd-4117-b79a-8fb22f0225aa/ Also, please understand Code Access Security in Reporting Services http://msdn.microsoft.com/en-us/library/ms155108.aspx Thanks, Jin
Free Windows Admin Tool Kit Click here and download it now
May 15th, 2009 11:20am

Jin,Thanks for prompt reply.I am unable to understand your suggestions.Are u saying.. the reason i am not able to run.. the javascript within embedded Vb code.. has something to do with Code Access security in Reporting services?Please let me know if my understand is correct?ThanksKiran R
May 15th, 2009 5:16pm

Hi KiranNJ,Yes. If you want to execute custom assemlies in Reporting Service, you need to trust the code the user executes.It is not only the JavaScript within embedded VB code, but all custom code ( Custom Assemblies) in Reporting Service.The Microsoft .NET Framework provides a robust security system that can run code in tightly constrained, administrator-defined security contexts. Reporting Services uses the .NET Framework security system, known as code access security (or evidence-based security). Under code access security, a user may be trusted to access a resource, but if the code the user executes is not trusted, access to the resource will be denied. Security based on code, as opposed to specific users, permits security to be expressed for custom assemblies or data, delivery, rendering, and security extensions that you develop for Reporting Services. Your extension code may be executed by any number of Reporting Services users, all of whom are unknown at development time. The custom assemblies or extensions that you develop require specific security policies in Reporting Services. These security policies are represented as types in the .NET Framework. If you have any more questions, please feel free to ask.Thanks,JinJin Chen - MSFT
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2009 3:53am

Jin,Before i start exploring code access security in SSRS 2005..There is one more question i have for you.Why doesnt the code work in... .Visual studio .NET IDE...Meaning.. when i preview the code in .NET studio.. it doesnt work there too.It throws an error saying.. Object reference not set to an instance of an object I would expect atleast the preview to work?? Or it shouldnt work either does the preview hit the server ??Let me know....
May 18th, 2009 9:12pm

Hi KiranNJ,To execute the code, you should need to refer the assembly "System.Web". Please use the following steps to add the reference: 1.In the Layout page, click the menu "Report" ---> "Report properties". 2.Switch to the tab "Reference", add the assembly "System.Web"For code executionpermission, please set the code group with the Zone"MyComputer" to be fulltrust.<CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="FullTrust" Description="This code group grants MyComputer code Execution permission. "> <IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" />Thanks,Jin Jin Chen - MSFT
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2009 4:11am

Hi I have a report with the following code impeded Function CheckSignificantDate(StartDate as Date, EndDate as Date) as Integer Dim msg as String msg = "" If (StartDate > EndDate) Then msg="Start Date should not be later than End Date" End If If msg <> "" Then System.Web.HttpContext.Current.Response.Write("<script language='javascript'>alert('hi');</script>") Err.Raise(6,Report) End If End Function i have added a parameter to execute the code "FromToDateValidation" i have added "System.Web" to the report deployed the report changed the rssrvpolicy.config file to match the configuration above and i ended up with the same error Error during processing of FromToDateValidation report parameter. (rsReportParameterProcessingError) can you please help me i think its a simple issue but it seams i cant locate the error ! thank you in advance Malik Al-Shayeb
September 27th, 2009 11:28am

Hi Mali,Did you get a solution for this problem, because I have the same problem.Thanks in advance!
Free Windows Admin Tool Kit Click here and download it now
January 6th, 2010 11:06pm

Jin, I added the reference "System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=myToken Is that enough to get the function to work in BIDS? My parameter the function is used with error's out. If I have to add the security XML, which file is it added to? The report server rssrvpolicy.config? Thanks
June 14th, 2010 11:29pm

Hi KiranNJ, To execute the code, you should need to refer the assembly "System.Web". Please use the following steps to add the reference: 1.In the Layout page, click the menu "Report" ---> "Report properties". 2.Switch to the tab "Reference", add the assembly "System.Web" For code execution permission, please set the code group with the Zone "MyComputer" to be fulltrust. <CodeGroup class="FirstMatchCodeGroup" version="1" PermissionSetName="FullTrust" Description="This code group grants MyComputer code Execution permission. "> <IMembershipCondition class="ZoneMembershipCondition" version="1" Zone="MyComputer" /> Thanks, Jin Jin Chen - MSFT Hi Jin, I have the same problem when I use this code to run javascript. Can you talk about more details about CodeGroup? Thanks a lot. Wei
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2011 4:46pm

Hi Jin, I have the same problem as well. Exactly as described by Malik in June 2009. I've done everything you've described: - Added system.web as a reference and redeployed the report - Modified rssrvpolicy.config to match the code above (and, then again to rsmgrpolicy.config and, thereafter to rspreviewpolicy.config) I continue to receive the rsReportParameterProcessingError when I enter an invalid date on report manager. Can I confirm that the system.web reference was deployed in combination with the report when I deployed it? What am I doing incorrectly? This is driving me crazy! Thanks, Sherry
May 31st, 2011 12:21pm

Hi Sherry, Just wanted to check if you have this issue solved. Please keep me updated. Thanks, Wei
Free Windows Admin Tool Kit Click here and download it now
June 3rd, 2011 9:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics