Search code examples
c#asp.net-mvc-4crystal-reportscrystal-reports-2010crystal-reports-viewer

Crystal Reports Graph image not displaying


I'm running IIS 8.5 on Windows 2012 R2 using Crystal Reports for VS2010 service pack 9.

No matter what I do I cannot get the image to display in the viewer... all other elements of the report are fine.

I've tried adding the handler which seemingly has no effect:

<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web,Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

The site / app pool is running under a local account and this account has full permission to C:/Windows/Temp - as does Network Service.

Furthermore I can see the graph image that is created in C:/Windows/Temp .... the blooming viewer will just not display it.

The site is running as a virtual directory, the parent site has aspnet_client setup as a virtual directory - which is why all the viewer button images etc are displayed correctly.

P.S. Fiddler4 is giving a status code of 302 (found?) for the image too!

Any ideas? I'm a bit stumped on this one.


Solution

  • The issue was twofold... the CrystalImagehandler.aspx was not being assigned, and the routing in MVC was blocking it once it was defined.

    The solution was to specify an IgnoreRoute entry in RegisterRoutes()

    routes.IgnoreRoute("CrystalImageHandler.aspx/{*pathInfo}");
    

    and put two entries in the web.config...

    <system.web>
      <httpHandlers>
          <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      </httpHandlers>
    </system.web>
    

    and

    <system.webServer>
        <handlers>
            <add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
        </handlers>
    </system.webServer>