Last post Jan 04, 2012 12:52 PM by kidkodiak
Dec 20, 2011 01:04 PM|jazzz308|LINK
I am having really tough time trying to figure this issue out. Here is my scenario of what I wanted to.
Dec 20, 2011 11:22 PM|Srikanth Kasturi|LINK
If your requriment is regarding passing of parameter from one report to another report you can use the sub reports of SSRS where you click on an item in the report and it Drilldowns to the subreport. This can be acheived by :
- Right click on the item for which you want to create a drilldown and select properties.
- Click on Action Tab of the properties and you can mention the subreport name there with the required parameter to be sent.
If your requirment is about passing the parameters to the reportviewer from C# code, it can be done as follows :
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.
Dec 21, 2011 08:04 AM|jazzz308|LINK
thanks for the reply Srikanth.
I would need to use 2nd solution to achieve what I want to do. Is there another way rather than do it in C#? what i did was create new web project and when I double click on page2.aspx it brings up page2.aspx.vb (Page_Load) is this the place where I would
need to put the code?
Dec 22, 2011 04:50 AM|Srikanth Kasturi|LINK
Yes please put the code in page_load.
Convert your code
Jan 04, 2012 12:52 PM|kidkodiak|LINK
Something like this: