Crystal Reports 图像未在 ASP.NET MVC 中加载

Crystal Reports Images not loading in ASP.NET MVC(Crystal Reports 图像未在 ASP.NET MVC 中加载)

本文介绍了Crystal Reports 图像未在 ASP.NET MVC 中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 MVC 应用程序内的 Web 表单中使用 Crystal Reports.但是,在 ASP.NET 开发服务器和 IIS 7(在 Win7x64 上)上都不会显示报告中的图像.

I'm using Crystal Reports in a Webform inside of an MVC application. Images in the reports are not being displayed, however, on both the ASP.NET Development Server and IIS 7 (on Win7x64).

我从许多其他类似的问题中知道 CrystalImageHandler HTTP 处理程序负责渲染图像,但我尝试了所有常用的解决方案都无济于事.

I know from a number of other questions similar to this that the CrystalImageHandler HTTP Handler is responsible for rendering the image, but I've tried all of the usual solutions to no avail.

到目前为止,我已经

  1. 在我的 appSettings 中添加了以下内容(通过 http://www.mail-archive.com/bdotnet@groups.msn.com/msg26882.html)

  1. Added the following to my appSettings (via http://www.mail-archive.com/bdotnet@groups.msn.com/msg26882.html)

<add key="CrystalImageCleaner-AutoStart" value="true"/>

<add key="CrystalImageCleaner-Sleep" value="60000"/>

<add key="CrystalImageCleaner-Age" value="120000"/>

将以下 httpHandler 添加到 system.web/httpHandlers(通过 https://stackoverflow.com/questions/2253682/crystal-report-viewer-control-isnt-loading-the-images-inside-the-report)

Added the following httpHandler to system.web/httpHandlers (via https://stackoverflow.com/questions/2253682/crystal-report-viewer-control-isnt-loading-the-images-inside-the-report)

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

在我的 Global.asax.cs 中添加了以下内容(通过 Crystal Reports 图片和 ASP.Net MVC)routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");

Added the following to my Global.asax.cs (via Crystal Reports Images and ASP.Net MVC) routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");

routes.IgnoreRoute("CrystalImageHandler.aspx");

关于为什么图像仍然是 404 的任何想法?

Any ideas as to why the images still 404?

推荐答案

我也遇到了类似的问题.这对我有帮助.

I had similar problem. This helped me.

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

这篇关于Crystal Reports 图像未在 ASP.NET MVC 中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Crystal Reports 图像未在 ASP.NET MVC 中加载