Visual Studio 2010 错误的水晶报表 [英] Crystal Reports for Visual Studio 2010 Error

查看:28
本文介绍了Visual Studio 2010 错误的水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从使用 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 版 - 标准 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) 适用于 .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:

不支持的操作.无法在 C++ 堆栈中打开 JRC 引擎处理的文档.

我该如何解决这个问题?

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 错误的水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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