创造asp.net MVC2水晶报表时出错 [英] Error when creating crystal report in asp.net mvc2

查看:283
本文介绍了创造asp.net MVC2水晶报表时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用水晶报表,并在页面加载我写这做了汇报。

I made a report using crystal report and in the page load I am writing this

protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument crystalReport = new ReportDocument();
        crystalReport.Load(Server.MapPath("CrystalReport.rpt"));
        crystalReport.SetDatabaseLogon
            ("amit", "password", @"AMIT\SQLEXPRESS", "TestDB");
        CrystalReportViewer1.ReportSource = crystalReport;
    }

和乳宁的页面时,我发现这个错误。

and when runing the page I found this error.

CS0433:类型'CrystalDecisions.Web.CrystalReportViewer在这两个存在'c:\\Windows\\assembly\\GAC_MSIL\\CrystalDecisions.Web\\10.5.3700.0__692fbea5521e1304\\CrystalDecisions.Web.dll'和'c:\\Windows\\assembly\\GAC_MSIL\\CrystalDecisions.Web\\13.0.2000.0__692fbea5521e1304\\CrystalDecisions.Web.dll'

CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\CrystalDecisions.Web\10.5.3700.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\Windows\assembly\GAC_MSIL\CrystalDecisions.Web\13.0.2000.0__692fbea5521e1304\CrystalDecisions.Web.dll'

推荐答案

我发现这个标签在我的web.config

I found this tag in my web.config

<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>

在我的aspx页面

and in my aspx page

<%@ Register Assembly="CrystalDecisions.Web,  Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

不同版本相同的程序集,使冲突所以我删除的web.config标记,它运行非常流畅。

different version for the same assembly makes the conflict so I removed web.config tag and it runs very smooth.

感谢。

这篇关于创造asp.net MVC2水晶报表时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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