Kum*_*mar 17 c# visual-studio-2010 crystal-reports asp.net-4.0
我正在尝试使用ASP.NET 4.0和Visual Studio 2010从我的Web应用程序运行水晶报表.我已经从SAP站点安装了以下内容(http://www.businessobjects.com/jump/xi/crvs2010 /us2_default.asp)
1)SAP Crystal Reports,Visual Studio 2010版本 - 标准EXE安装包,用于将软件安装到Visual Studio IDE中.
2)用于.NET Framework 4的SAP Crystal Reports运行时引擎(64位)
我有一个名为Reports.aspx的页面,其中我有一个水晶报表查看器控件
<CR:CrystalReportViewer ID="rptViewer" runat="server" AutoDataBind="true" />
Run Code Online (Sandbox Code Playgroud)
在Reports.aspx.cs文件中,我有以下代码:
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;
}
Run Code Online (Sandbox Code Playgroud)
在report.Load(path)行上,我收到以下错误:
不支持的操作.由JRC引擎处理的文档无法在C++堆栈中打开.
我怎样才能解决这个问题?
Ali*_*ini 10
确保报告在app_code文件夹中初始化它的新实例,而不是初始化报告文档并在其中加载报告.
Sample report = new Sample();
Run Code Online (Sandbox Code Playgroud)
这对我有用
您需要修改.rpt文件中的两个属性:
重建,构建部署包和发布.完成!
小智 5
注意:下面,术语"WebSite"指的是IIS中的实际网站节点,而不是网站中的虚拟目录.
问题根本原因:应用程序无法访问"aspnet_client"文件夹.
出现这种情况有几个原因:
问题解决方案(适用于Windows Server 2008 R2)
| 归档时间: |
|
| 查看次数: |
41869 次 |
| 最近记录: |