该项目是MVC5,但我为Crystal Report Viewer添加了Web表单 它可以工作,但无法在查看器中查看图像,但如果将其打印为Pdf,则可以工作 我找到了一些解决方案,但也没有用 我做到了 -添加到Web配置
<handlers>
<remove name="CrystalImageHandler.aspx_GET" />
<add name="CrystalImageHandler.aspx" verb="GET" path="CrystalImageHandler"
type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web,
Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304" />
</handlers>
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx"
type="CrystalDecisions.Web.CrystalImageHandler,
CrystalDecisions.Web,Version=13.0.2000.0, Culture=neutral,
PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
然后添加到global.asax
var p = Request.Path.ToLower().Trim();
if (p.EndsWith("/CrystalImageHandler.aspx") && p !=
"/CrystalImageHandler.aspx")
{
var fullPath = Request.Url.AbsoluteUri.ToLower();
var NewURL = fullPath.Replace(".aspx", "");
Response.Redirect(NewURL);
}
仍然无法正常工作
还尝试添加
<add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91"
validate="false" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode"
verb="*" path="Reserved.ReportViewerWebControl.axd"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91" />
到webcongif文件 我找不到问题所在,有什么帮助吗?