Is it possible to disable View Report button in ReportViewer control?
I'm using VS2008 in conjunction with 2005 SSRS, and the ProcessingMode of my ReportViewer control is Remote if that matters. I can disable the entire tool bar in my ReportViewer control because it's exposed in that control's properites, but can I somehow disable the View Report button? I want the user to be able to access and select report parameters without being able to preview the report...is this possible?
June 11th, 2011 1:11am

Hello jabberpunch, This forum is for UI technology, and we have SQL Server Reporting Services forum dedicated to this kind of questions. I'm moving it there to make it better response. Thank you for your posting.Helen Zhou [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2011 10:37pm

Hi jabberpunch, Generally, in order disable the View Report button, we can specify the ShowParameterPrompts property to False. However, this might not meet your requirement since you need to allow users to select report parameters. If you only want the user to be able to access and select report parameters without being able to preview the report, you can use Report Server Web Service to retrieve parameters information instead of the ReportViewer control. For more information, please refer to the ReportingService2005.GetReportParameters Method at http://msdn.microsoft.com/en-us/library/reportservice2005.reportingservice2005.getreportparameters.aspx Thanks, Tony Chain Tony Chain [MSFT CSG] | Microsoft Community Support Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help.
June 15th, 2011 10:37pm

Hi Tony, I will definitely look into using the Web Service as you suggested, but I'm not confident that will meet my needs. Do you know if it would be possible to somehow trap the on click event for the ReportViewer control's View Report button?? Thanks!
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2011 6:57pm

Hi Tony, I will definitely look into using the Web Service as you suggested, but I'm not confident that will meet my needs. Do you know if it would be possible to somehow trap the on click event for the ReportViewer control's View Report button?? Thanks!
June 20th, 2011 6:57pm

I reworked things so that the user selects the report parameters outside of the reportviewer, which enabled me to hide the View Report button and pass in the report parameters instead: private void LoadReport(string rptName, string pValue1, string pValue2) { rptViewer.ShowParameterPrompts = false; ReportParameter[] rptParameters = new ReportParameter[2]; rptParameters[0] = new ReportParameter(parameter1, pValue1); rptParameters[1] = new ReportParameter(parameter2, pValue2); rptViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote; rptViewer.ServerReport.ReportServerUrl = new Uri("http://xxx.xxx.xxx.xxx/ReportServer"); rptViewer.ServerReport.ReportServerCredentials.NetworkCredentials = new System.Net.NetworkCredential("username", "password"); rptViewer.ServerReport.ReportPath = "/MyReports/" + rptName; rptViewer.ServerReport.SetParameters(rptParameters); rptViewer.RefreshReport(); }
Free Windows Admin Tool Kit Click here and download it now
June 24th, 2011 5:41pm

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

Other recent topics Other recent topics