3

Windows Azure に展開された asp.net(VS2010 - .NET 4.0) アプリケーションがあります。.NET レポート ビューアー コントロールを使用しようとしています。レポートをローカル モードで実行しています。レポートは正常に機能し、正しく表示されます。Excel/PDF/Word にエクスポートしようとすると、「ASP.NET セッションが期限切れになったか、見つかりませんでした」というエラーが表示されます。

ここに私のサンプルコードがあります:ASP.NET

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RxCloudReports.Default" EnableSessionState="True" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
</script>
</head>
</head>
<body>
    <form id="form1" runat="server" enctype="multipart/form-data">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Local" SizeToReportContent="true" AsyncRendering = "true" 
                     ShowPageNavigationControls="true"   ShowExportControls="true" ShowToolBar="true" >

        </rsweb:ReportViewer>
</form>
</body>
</html>

C#

DataSet ds = GetDataSet(_ID, _Module);
ReportViewer1.Reset();
ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = "Reports/Reports1.rdlc";
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ReportDS", ds.Tables[0]));
ReportViewer1.LocalReport.Refresh();
4

4 に答える 4

3

設定しました

<rsweb:ReportViewer ... KeepSessionAlive="false" />

この後、Azureで動作しました(少なくとも私にとっては)。

于 2012-10-22T16:13:10.057 に答える
2

このリンクを確認してください。

このリンクは私にとってはうまくいきます。

ASP.NET セッションの有効期限が切れているか、見つからない -> Session.SessionID が変更されたため (Reporting Services)

ありがとう。

于 2012-11-09T16:33:06.390 に答える
1

私の場合; ReportViewer コントロールは iframe にあり、すべて正常に動作しますが、最近、私の Web サイトが機能しなくなりました。その理由は、Google Chrome のセキュリティ アップデートでした。ソリューションは、私のレポート サーバーのサブドメインに設定さ まし

注: このソリューションは、レポート コントロールに iframe を使用し、サイトが異なるドメインにある場合にのみ適用できます。

参照: 開発者: 新しい SameSite=None の準備をしてください。Secure Cookie 設定 のお知らせ: Azure App Service での SameSite Cookie 処理と .NET Framework 4.7.2 パッチの提供

于 2020-02-11T00:31:24.103 に答える