找不到 CrystalImageHandler.aspx [英] CrystalImageHandler.aspx not found

查看:16
本文介绍了找不到 CrystalImageHandler.aspx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 MVC3 应用程序的普通 ASP.NET aspx 页面上使用 Crystal 报表查看器.在控制器操作中,我只是重定向到 aspx 页面并且报告显示正常.但问题在于动态图像.我找到了最简单的解决方案,将图像路径作为报告参数传递并将此参数设置为图像源.在 Visual Studio 预览中这工作正常,但执行时我在页面上看到此错误.

I am using Crystal reports viewer on a normal ASP.NET aspx page in an MVC3 application. In a controller action I am simply redirecting to the aspx page and the report shows fine. But the problem is with dynamic images. I have found the simplest solution for this and this to pass the image path as a report parameter and set this parameter as image source. In Visual Studio preview this works fine but when executing I see this error on the page.

网络错误:404 未找到 -服务器/ReportWebForms/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_4fbcb73a-e001-4365-84fc-164788dd1605.png"

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

所以我假设,以前没有使用水晶报表的经验,问题出在 CrystalImageHandler.aspx.我在 Web.config 中有这些条目:

So I assume, having no previous experience with crystal reports, that the problem is in CrystalImageHandler.aspx. I have these entries in the 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>

这是一个 MVC 类型的问题吗?请问有人可以帮忙吗?

Is this an MVC type of a problem? Can anyone help with this please?

谢谢

推荐答案

我也遇到了同样的问题,幸好我对水晶报表有一些经验.

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

您只需要更改 Web.config,因为路径"属性设置为站点根目录.如果您在浏览器中打开 url 并从中删除 ReportWebForms,它将起作用.

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>

最后你必须为 MVC 应用程序的路由添加一条忽略规则:

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}");

在我的例子中,我有一个名为 Reports 的文件夹,其中放置了 .aspx 文件.我想您应该将其更改为 ReportWebForms 在您的情况下.

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.

这篇关于找不到 CrystalImageHandler.aspx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆