CrystalImageHandler.aspx not found

I am using Crystal Report Viewer on a regular aspx aspx page in an MVC3 application. In the controller action, I simply redirect to the aspx page, and the report shows that this is good. But the problem is dynamic images. I found the simplest solution for this and this is to pass the image path as a report parameter and set this parameter as the image source. In the preview of Visual Studio, this works fine, but when I execute this error, I see this error on the page.

"NetworkError: 404 Not Found - Server /ReportWebForms/CrystalImageHandler.aspx? Dynamicimage = cr_tmp_image_4fbcb73a-e001-4365-84fc-164788dd1605.png"

Therefore, I assume that having no experience with crystal reporting, the problem is in CrystalImageHandler.aspx. I have these entries in Web.config:

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

Is this a problem like MVC? Can anyone help with this please?

SEND TO YOU

+5
source share
3 answers

I had the same problem, but fortunately I have some experience with Crystal Reports.

You just need to modify the Web.config file because the site root has been set for the path attribute. It will work if you open the URL in a browser and remove ReportWebForms from it .

In fact, I added 2 more configuration lines:

<system.web>
    <httpHandlers>
      <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      <!-- Added -->
      <add verb="GET" path="Reports/CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
      <add verb="GET,HEAD" path="asset.axd" validate="false" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
    </httpHandlers>
</system.web>

<system.webServer>
    <handlers>
      <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
      <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" />
      <!-- Added -->
      <add name="CrystalImageHandler.aspx_GETR" verb="GET" path="Reports/CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
      <remove name="asset" />
      <add name="asset" preCondition="integratedMode" verb="GET,HEAD" path="asset.axd" type="Telerik.Web.Mvc.WebAssetHttpHandler, Telerik.Web.Mvc" />
    </handlers>
</system.webServer>

, , MVC:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
// Here is added new ignore rule
routes.IgnoreRoute("Reports/{resource}.aspx/{*pathInfo}");

, .aspx. , ReportWebForms .

+9

MVC. @Hovhannes. Routeconfig.cs

routes.IgnoreRoute("{*allaspx}", new { allaspx = @".*(CrystalImageHandler).*" });
+5

: RouteConfig.cs

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

. "" - , , aspx

+1

All Articles