Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More SSRS Woes
Message
General information
Forum:
Microsoft SQL Server
Category:
Reporting Services
Title:
More SSRS Woes
Miscellaneous
Thread ID:
01507135
Message ID:
01507135
Views:
109
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.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform