水晶报表图像和ASP.Net MVC [英] Crystal Reports Images and ASP.Net MVC

查看:491
本文介绍了水晶报表图像和ASP.Net MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用图表以及使用CrystalImageHandler.aspx图像时,其使用Crystal Reports的麻烦。该图像无法显示,我怀疑这是由于与MVC路由问题。

I am having trouble with Crystal Reports when using charts and images which use CrystalImageHandler.aspx. The image cannot display and I suspect this is due to a problem with MVC routing.

路径映像路径是类似这样的:

The path image path is similar to this:

src=\"/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_a8301f51-26de-4869-be9f-c3c9ad9cc85e.png\"

src="/CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_a8301f51-26de-4869-be9f-c3c9ad9cc85e.png"

通过类似这样的网址:

本地主机:01234 / ViewCrystalReports.aspx ID = 50

localhost:01234/ViewCrystalReports.aspx?id=50

图片不能prumably发现,因为它是在寻找一个不存在的目录。我怎样才能改变CrystalImageHandler.aspx位于路径?我想,如果我是从根本上的问题将得到解决,但是任何事情我在Web.Config中更改无法工作参考。

The image cannot be found prumably because it's looking in a non-existant directory. How can I change the path CrystalImageHandler.aspx is located at? I think if I were to reference from the root the problem would be solved but anything I change in Web.Config fails to work.

我应该提到这是一个传统的aspx页面上,而不是视图等。

I should mention this is on a conventional aspx page, not a view etc

推荐答案

想通了。路由与正被产生的CrystalImageHandler.aspx链路干扰。 Global.aspx有下面一行告知路由引擎忽略资源文件:

Figured it out. The routing was interfering with the CrystalImageHandler.aspx link that was being generated. Global.aspx has the following line to tell the routing engine to ignore resource files:

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

但是这不是一个传统的资源文件,这是由于某种原因,一个aspx文件(任何人都知道为什么吗?)

but this isn't a conventional resource file, it's an aspx file for some reason (anyone know why?)

添加这个固定的:

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

这篇关于水晶报表图像和ASP.Net MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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