hide report viewer parameters bar and use asp.net form controls to pass as parameters to dynamic server report
Hi I have set up a single report viewer on an asp.net web form and I have been able to assign 3 (just to test) parameters in code behind and launch a server report dyamically from code behind ( see code at bottom of message). All this is working ok, but even though I have set the reports parameters to allow nulls back in the report server solution the report viewer prompts me to click on the allow null check boxes before it will load. What I want to do is create a web reporting interface/menu bar in my web application, where users can select from a variety of datepickers, listboxes, text boxes, radio buttons etc then load the report. There will eventually be many reports using the same menu and all displayed through the single report viewer. I dont have a problem collecting the form data in code behind and assigning to parameters but when loaded I dont want the built in report viewer parameter fields to be visible to the user or active. If they need to ammend the report by changing parameter values the they will use my reporting interface to do so. Can anyone provide some advice to achieve this. eportViewer1.ProcessingMode = ProcessingMode.Remote; //pass the security credentials to view the reports ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerCredentials("", "", ""); ServerReport serverReport = ReportViewer1.ServerReport; // Set the report server URL and report path serverReport.ReportServerUrl = new Uri(""); serverReport.ReportPath = "/PAD Report Project/Property_Disposals_Date"; // Create the sales order number report parameter //ReportParameter Date = new ReportParameter(); //Date.Name = "Date"; Date.Values.Add("01/01/2011"); ReportParameter Date = new ReportParameter("Date", "01/01/2011"); ReportParameter OPStatus = new ReportParameter("OPStatus", "1"); ReportParameter Name = new ReportParameter("Name", ""); //ReportParameter p4 = new ReportParameter("Error_4", Error_4_value); //this.reportViewer1.ShowParameterPrompts = true; //this.reportViewer1.ServerReport.SetParameters(new ReportParameter[] { SecUserID }); // Set the report parameters for the report ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { Date,OPStatus,Name }); ReportViewer1.SizeToReportContent = true; ReportViewer1.ServerReport.Refresh();
November 22nd, 2012 9:56am

Hi HomeMadeDeveloper, To hide the report parameter prompt area and the toolbar of the ReportViewer control, we can simply set the "ShowParameterPrompts" property and the "ShowToolBar" property of the ReportViewer control to "False". Furthermore, we can set the visibility of the toolbar items through the properties such as "ShowBackButton", "ShowFindControls" and "ShowZoomControl". References: ReportViewer PropertiesConfiguring and Using the ReportViewer Toolbar Hope this helps. Regards,Mike Yin TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2012 5:32am

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

Other recent topics Other recent topics