带有 Crystal 报表会话的 ASP.NET 网站无法在 iis 服务器 8 及更高版本中运行,但可以在 IIS 7 中运行

问题描述

我有一个在 VS 2008 中开发的 ASP.NET Web 应用程序,它托管在 IIS 7 中并且运行良好,当我将代码移动到 Windows 2019 服务器 IIS 10 时,相同的代码不适用于弹出窗口。 在使用窗口打开页面时。打开会话变量正在重置。

我想提一下,这个页面包含一份水晶报告。 在服务器中也安装了水晶报表运行时。

请帮忙。

该应用程序是在 VS 2008 中开发的,在按钮客户端单击系统上打开一个包含多个子报表的水晶报表页面。 该报告不直接连接到数据库,而是通过页面加载时填充的数据集连接。 在服务器中托管代码后,出现以下错误

logon Failed. Error in File C:\windows\TEMP\Reportname{F8EE4295-91EE-476B-95A7-E950D05B41FD}.rpt: Unable to connect: incorrect log on parameters.

这是使用的代码

protected void Page_Load(object sender,EventArgs e)
{
this.CrvSingleGTINReport.SeparatePages = true;               
reportDoc.Load(reportFilePath);
ReportdataLoad (reportDoc);
CrvSingleGTINReport.ShowFirstPage();                      
}

public void ReportdataLoad(ReportDocument reportDocument)
{
DataTable Data;
if (Session["Data"] != null)
{
Data = new DataTable();
Data = (DataTable)Session["Data"];
reportDocument.SetDataSource(Data);
reportDoc.PrintOptions.PaperOrientation = PaperOrientation.Landscape;
CrvSingleGTINReport.ReportSource = reportDoc;                    
}           
}
    

解决方法

通过安装 32 位 Crystal 报表运行时并在应用程序池中启用 32 位应用程序,我能够解决该问题。 还配置了 ODBC 32 位。