SSRS report through C#. [Resolved]

Posted by Amatya under C# on 10/28/2016 | Points: 10 | Views : 1639 | Status : [Member] | Replies : 3
I want to create SSRS Report in web Application where in a GridView I want to give the Hyperlink of View and according to that row Id I want to show SSRS Report of that record. Can anyone help. Its urgent

Thanks in Advance

Feel free to share informations.
mail Id ' adityagupta200@gmail.com
Thanks



Responses

Posted by: Rajnilari2015 on: 11/10/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
@Amatya Sir, we have written an article on the same ( http://www.codeproject.com/Articles/194097/SSRS-Series-Part-I-Various-ways-of-Report-creation#6 )

In this code snippet of that article


try
{
ReportParameter[] repParams = new ReportParameter[1];
repParams[0] = new ReportParameter("PlayerID", "10");
repViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
repViewer.ServerReport.ReportServerUrl = new Uri("http://niladri-pc/ReportServer_NILADRIDENALI");
repViewer.ServerReport.ReportPath = "/BasicSSRSReport_Part1/Player Report";
repViewer.ServerReport.SetParameters(repParams);
repViewer.ServerReport.Refresh();
}
catch (Exception ex)
{
throw ex;
}



pass the value(id) in the line
...............................
repParams[0] = new ReportParameter("PlayerID", id);
..............

Hope that will help you to proceed.

--
Thanks & Regards,
RNA Team

Amatya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amatya on: 11/13/2016 [Member] Silver | Points: 25

Up
0
Down
Hi.
I have done as you told but on this line its showing error
 ReportViewer1.ServerReport.SetParameters(repParams);

The request failed with HTTP status 401: Unauthorized.
The code which I have written is as follow-
  ReportParameter[] repParams = new ReportParameter[1];
repParams[0] = new ReportParameter("ReportParameter1", "10");
ReportViewer1.ProcessingMode = ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://sw23/Reports");
ReportViewer1.ServerReport.ReportPath = "/PAMS/UserReport";
ReportViewer1.ServerReport.SetParameters(repParams);
ReportViewer1.ServerReport.Refresh();
ReportViewer1.ServerReport.Refresh();


Feel free to share informations.
mail Id ' adityagupta200@gmail.com
Thanks

Amatya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Amatya on: 11/13/2016 [Member] Silver | Points: 25

Up
0
Down
and Iam using SQL Server 2014 Management Studio.


Thanks in Advance

Feel free to share informations.
mail Id ' adityagupta200@gmail.com
Thanks

Amatya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response