Report Viewer problems

Discussion in 'Windows / IIS' started by SantyNet, Sep 23, 2009.

  1. I'm trying to run my report on a webapp in localmode, but I continue to have problems.

    I keep receiving this error:
    HTTP Error 404.0 - Not Found
    The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    The APP works fine in my local dev, but on DASP it's giving me this problem.

    Here's the code behind

    ReportViewer1.Visible = true;
    ReportViewer1.Dispose();
    ReportViewer1.Reset();
    ReportViewer1.ProcessingMode = ProcessingMode.Local;
    ReportViewer1.LocalReport.ReportEmbeddedResource = "EduSoftware.EnrollmentByAID.rdlc";
    ReportDataSource rds = new ReportDataSource("RegistrationsbyHID_SelectRegistrationsByAID", oReg.RegistrationCollection);
    ReportViewer1.LocalReport.DataSources.Clear();
    ReportViewer1.LocalReport.DataSources.Add(rds);
    ReportViewer1.DataBind();


    The report file EnrollmentByAID.rdlc is inside the same directory where this page is run from.

    I'm running out of ideas.. thanks.
     
  2. I'm glad you guys are talking about the Report Viewer because I've had a heck of a time trying to get it to work on the web server (DASP). This is my first time using it.

    First, I'm not using Reporting Services. This is a simple report. I finally made some progress today and now have a different error.

    I followed this article and added the Handler Mapping to my site.
    http://ericphan.info/development/reserved-reportviewerwebcontrol-axd-not-found/

    Now I'm receiving this error:

    Could not load type 'Microsoft.Reporting.Microsoft.Reporting.WebForms.HttpHandler' from assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d

    So I followed this other article I found and uploaded the ReportViewer DLLs into my App's BIN folder:
    http://www.kodyaz.com/articles/assembly-Microsoft.ReportViewer.WebForms.aspx

    Now I'm stuck. :-( Please let me know what I'm doing wrong.

    I'm running the Reports in Local Mode. Here's some of the code to give you an idea:

    ReportViewer1.Reset();
    ReportViewer1.ProcessingMode = ProcessingMode.Local;
    ReportViewer1.LocalReport.ReportPath = @"EnrollmentByHIDrdlc.rdlc";
    ReportViewer1.LocalReport.ReportEmbeddedResource = "EduSoftware.EnrollmentByHIDrdlc.rdlc";
    ReportDataSource rds = new ReportDataSource("RegistrationsbyHID_SelectRegistrationsByHID", oReg.RegistrationCollection);
    ReportViewer1.LocalReport.DataSources.Clear();
    ReportViewer1.LocalReport.DataSources.Add(rds);
    ReportViewer1.DataBind();

    It works fine in my local environment.

    Thanks,

    Santy
     
  3. Hi,
    Are you on an IIS7 server here?
    If so, do you have a handler in your root web.config like this?

    <httpHandlers>
    <remove path="*.asmx" verb="*" />
    <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
    </httpHandlers>
     
  4. It's in my webconfig

    Wisemx,

    Thanks for the reply.. your posts have helped me get this far... I'm almost home :)

    Yes and No to your question.

    This app is inside a directory as an app. In the app directory I do have the httpHandlers in the webconfig.

    I do not have it in the webconfig in the root, but I do not use reports there. Does this make a difference?

    Here's what I have :
    <httpHandlers>
    <remove path="*.asmx" verb="*" />
    <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    validate="false" />
    <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    validate="false" />
    <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
    validate="false" />
    <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    validate="false" />
    </httpHandlers>

    Thanks
     
  5. Still Not working...

    Wisemx,

    I went ahead and added it to the root, and now it went back to the problem of HTTP ERROR 404, The resource you are looking for has been removed..

    I'm about to give up and go back to HTML reports :-(
     
  6. ...I gave up on testing the reporting services because of the awesome new differences in SQL Server 2008.
    (The DASP crew has been responding to all the requests for the new reporting services, not ready to implement them here yet.)

    If you get into a real pinch with this I'll try and dig back in.
    They provide me with the servers as needed.
    ...And I do have some working code here, somewhere.
    (Insert a whacky photo of a stay-at-home Dad looking for old code examples.)
    All the best,
    Mark
     

Share This Page