Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More SSRS Woes
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Services de reporting
Titre:
More SSRS Woes
Divers
Thread ID:
01507135
Message ID:
01507135
Vues:
110
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform