CrystalImageHandler.aspx not found

丶灬走出姿态 提交于 2019-11-30 20:22:44

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

You just need to change the Web.config, because the "path" attribute is set to site root. It will work if you open the url in browser and remove the ReportWebForms from it.

Actually I've just added 2 more lines of configuration:

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

And finally you have to add an ignore rule the route for MVC application:

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

In my case I have a folder named Reports where the .aspx file is placed. I guess you should change this to ReportWebForms in your case.

In my case I only had to ignore MVC's routing.To add onto @Hovhannes solution.You should add this rule to Routeconfig.cs

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

Answers: Add this in RouteConfig.cs file

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

Note : "Reports" is the directory name which contains crystal reports viewing aspx page

sceliktas

Use this code as CrystalImageHandler.aspx:

<%@ Page Language="C#" AutoEventWireup="true" %>

<script runat="server" language="c#" >
    protected void Page_Load(object sender, EventArgs e)
    {
        CrystalDecisions.Web.CrystalImageHandler handler = new CrystalDecisions.Web.CrystalImageHandler();
        handler.ProcessRequest(this.Context);            
    }
</script>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!