Handling Events in Reporting Services View Contol
Hi There, I want to handle events like Key Stroke (OnKeyPress, OnKeyDown, OnKeyUp) or events like "Parameters Loaded", "Query Execution Begin", "Query Execution End", "Report Execution Begin", "Report Execution End" etc in the Report Manager View Control. Where can I find documentation on the possible events, e.g. I know I can code an OnInit procedure in the code block of the report. But how for example do I code the OnKeyDown procedure? I have tried: References: System.Windows.Forms Sub MeKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown msgbox("MeKeyDown") End Sub Gives me: [rsCompilerErrorInCode] There is an error on line 48 of custom code: [BC30590] Event 'KeyDown' cannot be found. Sub MeKeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Rs.KeyDown msgbox("MeKeyDown") End Sub Gives me: [rsCompilerErrorInCode] There is an error on line 48 of custom code: [BC30506] Handles clause requires a WithEvents variable defined in the containing type or one of its base types. Help me please!?!? Regards Jos
August 30th, 2010 8:26am

Hi Jos, Do you mean you want to handle events when the report is displayed in the Report Manager? As you posted, I try to handle events by custom after refer the assembly to the report and get the same error message. It is by design that the report can only be processed by Report Server, in other words, we are not allowed to handle events even use custom code or assembly. To handle events of the Report Viewer, you can create a custom WinForm or Web application with using ReportViewer control in it. There are some events can be handled of the ReportViewer control. For more information about using ReportViewer control, please see: http://msdn.microsoft.com/en-us/library/ms252104(v=VS.90).aspx If you have any question, please feel free to ask. Thanks, Tony Chain
Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2010 2:05am

Hi Tony, I am using SSRS 2005 within Visual Studio 2005 Pro. At the one hand I have de development stage of the report in VS. After the report is deployed for use by the end-user to a production server, the user can access the reports in the internet explorer by: http://intrasrv/reports/Pages/Folder.aspx, where intrasrv is the production server. Now I want to handle keystrokes or other events, after the user has navigated to the particular report he/she wants to run. So where can I find how can I handle these events like OnInit (that I know works) but specifically OnKeyDown. What references must I add, what parameters must I supply, what values can I set???? Regards, Jos
September 2nd, 2010 2:59am

Hi Jos, Based on your description, in Reporting Services 2005 within Visual Studio 2005, I created a OnInit event handler in custom code and deployed to the Report Server. However, even there is no error message, when I check the report in Report Manager, the event handler doesn’t execute. So as I posted before, we are not allowed to handle events because they are all controlled by Report Server. To handle events of the Report Viewer, we can create a custom WinForm or Web application with using ReportViewer control in it. For more information about using ReportViewer control, please see: http://msdn.microsoft.com/en-us/library/ms252104(v=VS.90).aspx Thank you for your understanding. Best Regards, Tony Chain
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2010 4:26am

Hi Tony, Could you please check: ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.SQLSVR.v9.en/rptsprg9/html/26fd74dc-d02f-40f7-aeb3-50ce05e9e6b9.htm If I put this in the code tab of a .rdl: Protected Overrides Sub OnInit() ' m_myClass.MyInitializationMethod(User!Language, Parameters!Territory) MsgBox("OnInit") End Sub I get 'OnInit' to displayed on starting the report in Visual Studio. After deploying I get the message: An error occurred while executing OnInit: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. (rsErrorInOnInit) At any rate: the OnInit is invoked in either cases. I suppose I should specify ServiceNotification in order to display the MsgBox in the deployed version......... Regards, Jos
September 3rd, 2010 4:22pm

Hi Jos, I have asked the product group and they confirmed that OnInit is the only one event handler can be overridden. From the documentation you posted, override OnInit method is dedicated to perform initialization tasks. If you need to implement more function to handle events, we can create a WinForm or Web application with ReportViewer control as I mentioned before. If you have any question, please feel free to ask. Thanks, Tony Chain
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2010 2:18am

Hi Tony, Your suggestion would require a WinForm or a Web application bypassing the Report Manager as the user-interface. This however is not allowed in my organization, neither a WinForm, a Web application or bypassing the Report Manager. It is therefore I am desparately trying to find a method to add some functionality to this Report Manager environment. On the other hand it escapes me, why that would not be allowed from Microsofts point of view. Can you tell me why no user functionality is allowed to work within the Report Manager environment? Thanks in advance, Jos
September 30th, 2010 10:49am

I guess you received no answer because they don't want to tell you how to run your business, but by virtue of this tool, they have dictacted how you need to run your business if you want this functionality... good luck.
Free Windows Admin Tool Kit Click here and download it now
June 1st, 2012 11:03am

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

Other recent topics Other recent topics