Last post Feb 02, 2012 07:17 AM by jaspalsingh183
Jan 31, 2012 11:04 AM|Gindy39|LINK
Good day all, not sure under which thread to post my question since it can be apply to 3 . Anyway my question is simple, and I do feel like a newbie asking it , which I am :-).
I just finish my report, using reporting services. Now I just want the user to click on a button, and when he clicks on it, I want the report to open. I have never done this so I don't have a clue as to what is the code in order for the report to launch
when they click the button.
Thank you for your time,
Jan 31, 2012 11:20 AM|kedarrkulkarni|LINK
hope this helps...
Jan 31, 2012 12:18 PM|Srikanth Kasturi|LINK
This surely is an interesting aspect of .net and reporting services. Once the reports are deployed onto any server. You can use a reportviewer control to view them over your web pages. However, there are couple of ways to do this, with using the parameters
of the reporting server itself, or by using custom paramters. Below is the simple code, which will allow you to start off with this..
Any more issues shud you run into, please feel free to post it here.
reportViewer.ServerReport.ReportServerUrl = new System.Uri(ConfigurationManager.AppSettings["ReportServerURL"]);
reportViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
reportViewer.ToolBarItemBorderColor = System.Drawing.Color.PowderBlue;
reportViewer.ToolBarItemBorderStyle = BorderStyle.Double;
string strUserName = ConfigurationManager.AppSettings["UserName"].ToString();
string strPassword = ConfigurationManager.AppSettings["Password"].ToString();
string strDomain = ConfigurationManager.AppSettings["Domain"].ToString();
reportViewer.ServerReport.ReportServerCredentials = new ReportCredentials(strUserName, strPassword, strDomain);
string strReport = string.Empty;
strReport = ConfigurationManager.AppSettings["ReportsFolder"] + Request.QueryString["ReportName"].ToString();
Below snippet shows on how to pass parameters to the report :
this.reportViewer.ServerReport.ReportPath = strReport;
RptParameters = new Microsoft.Reporting.WebForms.ReportParameter;
RptParameters = new Microsoft.Reporting.WebForms.ReportParameter(" <ParameterName>", "<ParameterValue>");
You can pass any number of parameters to the report. Just make sure that the <ParameterName> matches with the parameter name in the report.
Feb 02, 2012 07:17 AM|jaspalsingh183|LINK
new to SSRS
may i know the benefits of using SQL Server Reporting Services we can do this by simply retreving data by sql select statement
into dataset then in gridview.