Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Still Can't Get SSRS To Work

Still Can't Get SSRS To Work

Scheduled Pinned Locked Moved Database
csharpsql-serverwinformshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    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. Thanks

    Everything makes sense in someone's mind

    T 1 Reply Last reply
    0
    • K Kevin Marois

      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. Thanks

      Everything makes sense in someone's mind

      T Offline
      T Offline
      thatraja
      wrote on last edited by
      #2

      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...
      **

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups