locked
Problems with ReportViewer RRS feed

  • Question

  • User260076833 posted

    Hello,

    I have a project using ReportViewer,which is working fine.
    But I failed creating another project using the same code.

    The original, working project uses the following References:

    • Microsoft.ReportViewer.Common
    • Microsoft.ReportViewer.ProcessingObjectModel
    • Microsoft.ReportViewer.WebForms

    All references are at version 11.0.0.0.

    The web.config contains these lines:

    <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
    

    The aspx-files using it contain this line:

    <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    

    However, in the new project, I get a JS exception: "Microsoft is undefined".

    First, I tried to use the new version 12 of ReportViewer, which I installed on the machine. I added the references under C:\Windows\assembly\GAC_MSIL, all in version 12. And I also adapted the Web.Config and the references in the aspx-files. At this point, I didn't know what to use as PublicKeyToken. I found something on the net. But I always got the error "Microsoft is undefined", even after cleaning and recompiling the project.

    Then, I wanted to resign and move to version 11. I changed everything: the references, the Web.config and the aspx-files. But I keep getting this error.

    I believe I do not understand the dependencies. Could someone please help me out of this?

    Thanks
    Magnus

    Sunday, October 11, 2015 9:44 AM

All replies

  • User-166373564 posted

    HI Magnus,

    I tried to use the new version 12 of ReportViewer, which I installed on the machine. I added the references under C:\Windows\assembly\GAC_MSIL, all in version 12.

    From your description above, please check following items:

    1. Make sure you download and install REPORT VIEWER 2015 RUNTIME properly.

    https://www.microsoft.com/en-us/download/details.aspx?id=45496

    2. These apply to installing anything into the GAC.

    https://msdn.microsoft.com/en-us/library/dkkx7f79%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    Please let me know if you need help.

    With regards,

    Angie

    Tuesday, October 13, 2015 5:50 AM
  • User260076833 posted

    Hello Angie!

    1. Make sure you download and install REPORT VIEWER 2015 RUNTIME properly.

    Ok, using your download link I noticed that there is a newer version. I downloaded it and installed it.

    2. These apply to installing anything into the GAC.

    Do I have to install anything manually into the GAC? Or how is the new version of ReportViewer available in MSVS?
    The last time I installed ReportViewer, I had to add the DLLs under C:\Windows\assembly\GAC_MSIL manually.

    But besides that, even with the older ReportViewer, I had a working project and I didn't manage to make a new project working the same way.
    I believe that I am doing something wrong when creating an aspx-page with ReportViewer.

    Thank you
    Magnus

    Tuesday, October 13, 2015 11:16 AM
  • User260076833 posted

    Hello,

    I am still totally stuck, please help!

    Here is a detailed description of what I do when creating a new project that uses ReportViewer. I am sure I am doing something wrong:

    • Create a new ASP.NET project/solution based on Web Forms in MSVC.
    • Copy a existing, working(!) report (aspx + rdlc) from another project into the new project.
      (The existing report references ReportViewer 11).
    • When I try to open it, I get an error, because there are no references to ReportViewer yet.
      "The type or namespace name 'Reporting' does not exist..."
    • Then, I go to Project -> Add reference..."
    • In the "Extension" tab there are three items related to ReportViewer (Common, WebForms, WinForms), but all at version 10.0.0.0.
      So these cannot be the references I have installed lately.
    • Then, the only thing I still can do is "Browse" and select some DLLs from the hard disk.
      This is somewhat unreliably, because I don't know anything about the locations of the files I installed when I installed ReportViewer.
      I can only guess or google. So I try to avoid it at the first time. I make another test instead:
    • I create a new WebForm and drag a ReportViewer item from the toolbox on it
      This creates a "Register" tag in the WebForm and three entries in Web.config:
      <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
      <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
      <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
      <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    • These must be wrong, because I installed the newest ReportViewer, which should be version 12, and there exist folders under C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.*, e. g. Common\12.0.0.0__89845dcd8080cc91, so we should have at least version 12 available.
      So dragging from the toolbox does not help.
      However, I also tested the existing reports (which use version 11) from the other project with this version 11 of the ReportViewer: I get the following error message:
      Unhandled exception at line 390, column 5 in http://localhost:49980/TestReport.aspx
      0x800a1391 - JavaScript runtime error: 'Microsoft' is undefined
    • Then, I remove the entries in the Web.config and return to the "Add reference" panel. This time, I go to "Browse" and select files from the hard disk:
      C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\12.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL
    • When, when I open the existing report from the other project (which references version 11), I get an incompatibility error:
      The base class includes the field 'ReportViewer', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).
    • I know this must be because I added the reference for version 12, but the report references version 11:
      <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
    • I change the version in the Register tag to "12.0.0.0, and I leave the value for PublicKeyToken as is, because I don't know another value.
      Then, I again get "Microsoft is undefined".

    At this point, I don't know how to go any further. I cannot believe that you have to collect individual DLLs somewhere on your hard disk. Instead, the ReportViewer should be somewhat "registered" in MSVS, so that you get version 12 reports when you drag one from the toolbox.

    I really don't know what else to try. But I hope, the description above is detailed enough so that someone can see what I am doing wrong.

    Please help!

    Thanks
    Magnus

    Thursday, October 15, 2015 1:37 AM