水晶报表的Visual Studio 2010中的错误 [英] Crystal Reports for Visual Studio 2010 Error
问题描述
我试图从中使用ASP.NET 4.0和Visual Studio 2010中我已经安装了从SAP网站以下(<内建我的web应用程序运行的水晶报表href=\"http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp\">http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp)
I am trying to run a crystal report from my web application which was built using ASP.NET 4.0 and Visual Studio 2010. I have installed the following from the SAP site (http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp)
1)SAP Crystal Reports中,版本的Visual Studio 2010 - 标准EXE安装包,它安装软件到Visual Studio IDE
1) SAP Crystal Reports, version for Visual Studio 2010 - Standard EXE installation package which installs the software into the Visual Studio IDE.
2)的SAP Crystal报表用于.NET Framework运行时引擎4(64位)
2) SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit)
我有一个名为Reports.aspx页面中,我有一个水晶报表查看器控件
I have a page called Reports.aspx in which I have a crystal report viewer control
<CR:CrystalReportViewer ID="rptViewer" runat="server" AutoDataBind="true" />
在Reports.aspx.cs文件我有以下的code:
In the Reports.aspx.cs file I have the following code:
protected override void OnPreRender(EventArgs e)
{
ReportDocument report = new ReportDocument();
var path = Server.MapPath("Reports/Sample.rpt");
report.Load(path);
report.SetDatabaseLogon("username", "password", "servername", "databasename");
rptViewer.ReportSource = report;
}
在report.Load(路径)行我得到以下错误:
On the report.Load(path) line I get the following error:
不受支持的操作。由JRC引擎处理的文档不能在C ++堆栈中打开。
我该如何解决这个问题?
How can I fix this?
推荐答案
请确保该报告是 APP_ code
文件夹
初始化它的一个新的实例,而不是初始化的ReportDocument,并在其中加载的报告。
make sure the report is in app_code
folder
initialize a new instance of it instead of initializing a reportdocument and loading the report in it.
Sample report = new Sample();
这为我工作
这篇关于水晶报表的Visual Studio 2010中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!