ReportViewer.KeepSessionAlive 屬性
發佈時間: 2016年4月
取得或設定 Boolean 值,這個值表示是否只要 ReportViewer 執行中,就讓報表伺服器工作階段保持不過期。
命名空間: Microsoft.Reporting.WinForms
組件: Microsoft.ReportViewer.WinForms (在 Microsoft.ReportViewer.WinForms.dll 中)
語法
public bool KeepSessionAlive { get; set; }
public:
property bool KeepSessionAlive {
bool get();
void set(bool value);
}
member KeepSessionAlive : bool with get, set
Public Property KeepSessionAlive As Boolean
屬性值
Type: System.Boolean
true 表示讓報表伺服器工作階段保持不過期,否則為 false。預設為 true。
備註
此外,在遠端處理模式中,將這個屬性設定為 true,會讓 ReportViewer 控制項保持伺服器工作階段不過期狀態。ReportViewer 控制項會 Ping 報表伺服器,讓報表伺服器工作階段保持不過期。如果您要讓報表伺服器工作階段即使沒有活動也要保持作用中,請將 KeepSessionAlive 設定為 true。若要在應用程式中讓工作階段逾時及過期,請將 KeepSessionAlive 設定為 false。
在本機處理模式中,設定這個屬性沒有作用。
如果 KeepSessionAlive 設定為 false,而且已建立報表伺服器工作階段,便無法將這個屬性設定為 true。這樣做會導致擲回 InvalidOperationException。
請參閱
ReportViewer 類別
Microsoft.Reporting.WinForms 命名空間
回到頁首