Crystal Reports for Visual Studio 2010 Error(用于 Visual Studio 2010 错误的 Crystal Reports)
问题描述
我正在尝试从使用 ASP.NET 4.0 和 Visual Studio 2010 构建的 Web 应用程序运行水晶报表.我已经从 SAP 站点安装了以下内容 (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 版 - 将软件安装到 Visual Studio IDE 中的标准 EXE 安装包.
1) SAP Crystal Reports, version for Visual Studio 2010 - Standard EXE installation package which installs the software into the Visual Studio IDE.
2) 适用于 .NET Framework 4(64 位)的 SAP Crystal Reports 运行时引擎
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 文件中我有以下代码:
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(path) 行我收到以下错误:
On the report.Load(path) line I get the following error:
不支持的操作.JRC 引擎处理的文档无法在 C++ 堆栈中打开.
我该如何解决这个问题?
How can I fix this?
推荐答案
确保报告在 app_code
文件夹中初始化它的新实例,而不是初始化报表文档并将报表加载到其中.
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 错误的 Crystal Reports的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用于 Visual Studio 2010 错误的 Crystal Reports


基础教程推荐
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01