Still Can't Get SSRS To Work
-
I'm trying to display an SSRS report in a ReportViewer control in a WinForms application. Here's the Form_Load...
private void Form1_Load(object sender, EventArgs e)
{
reportViewer1.ServerReport.ReportServerUrl = new Uri("http://192.168.2.5/reportserver");
reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = CredentialCache.DefaultCredentials;string reportFile = @"C:\\Report Project1\\Report1.rdl"; reportViewer1.ServerReport.ReportPath = reportFile; reportViewer1.ProcessingMode = ProcessingMode.Remote; reportViewer1.ServerReport.DisplayName = "Corporate View Report"; ReportParameter\[\] parameters = new ReportParameter\[3\]; parameters\[0\] = new ReportParameter("@ProjectId", "6"); parameters\[1\] = new ReportParameter("@PrimaryWhseId", "8293"); parameters\[2\] = new ReportParameter("@SecondaryWhseId", "8290"); reportViewer1.ServerReport.SetParameters(parameters); try { reportViewer1.RefreshReport(); } catch(Exception ex) { throw ex; }
}
With the
reportViewer1.ServerReport.SetParameters(parameters);
line uncommented, at this point the form pops ups, the repot is blank, and nothing else happens after that. If I comment out the parameters and run it the form runs and in the viewer control I get "The request failed with HTTP status 401: Unauthorized". I can't find any examples of displaying a SSRS report in a WinForms application. I could really use some help here. ThanksEverything makes sense in someone's mind
-
I'm trying to display an SSRS report in a ReportViewer control in a WinForms application. Here's the Form_Load...
private void Form1_Load(object sender, EventArgs e)
{
reportViewer1.ServerReport.ReportServerUrl = new Uri("http://192.168.2.5/reportserver");
reportViewer1.ServerReport.ReportServerCredentials.NetworkCredentials = CredentialCache.DefaultCredentials;string reportFile = @"C:\\Report Project1\\Report1.rdl"; reportViewer1.ServerReport.ReportPath = reportFile; reportViewer1.ProcessingMode = ProcessingMode.Remote; reportViewer1.ServerReport.DisplayName = "Corporate View Report"; ReportParameter\[\] parameters = new ReportParameter\[3\]; parameters\[0\] = new ReportParameter("@ProjectId", "6"); parameters\[1\] = new ReportParameter("@PrimaryWhseId", "8293"); parameters\[2\] = new ReportParameter("@SecondaryWhseId", "8290"); reportViewer1.ServerReport.SetParameters(parameters); try { reportViewer1.RefreshReport(); } catch(Exception ex) { throw ex; }
}
With the
reportViewer1.ServerReport.SetParameters(parameters);
line uncommented, at this point the form pops ups, the repot is blank, and nothing else happens after that. If I comment out the parameters and run it the form runs and in the viewer control I get "The request failed with HTTP status 401: Unauthorized". I can't find any examples of displaying a SSRS report in a WinForms application. I could really use some help here. ThanksEverything makes sense in someone's mind
Here you go You receive error 401.1 when you browse a Web site that uses Integrated Authentication and is hosted on IIS 5.1 or a later version[^] Reporting Services - Troubleshooting[^](search section 5.4 “The request failed with HTTP status 401: Unauthorized”) For you information How to implement impersonation in an ASP.NET application[^]
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
**