原創(chuàng)|其它|編輯:郝浩|2012-09-13 17:52:21.000|閱讀 762 次
概述:這個(gè)例子演示了一個(gè)Report Definition報(bào)表定義怎樣被保存到一個(gè)會(huì)話(huà)對(duì)象,并從中恢復(fù)。XtraReport.SaveLayout和XtraReport.FromStream方法用于在流中保存報(bào)表,并從流中加載。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
注意:這個(gè)特性不受網(wǎng)絡(luò)客戶(hù)端配置文件框架的支持。如果要使它可以在終端用戶(hù)的機(jī)器上使用,就必須安裝完整的.NET框架。要了解更多信息,請(qǐng)參見(jiàn)Windows Forms Deployment部署文件的.NET框架4.0戶(hù)端配置文件部分的重要注釋。(DevExpress報(bào)表控件XtraReports下載)
這個(gè)例子演示了一個(gè)Report Definition報(bào)表定義怎樣被保存到一個(gè)會(huì)話(huà)對(duì)象,并從中恢復(fù)。
XtraReport.SaveLayout和XtraReport.FromStream方法用于在流中保存報(bào)表,并從流中加載。對(duì)于一般的信息,請(qǐng)參考Storing Report Definitions。
//documentation.devexpress.com/#XtraReports/CustomDocument2592。
C#
using System.IO;
using DevExpress.XtraReports.UI;
// ...
private void StoreReport(XtraReport report) {
// Create a stream.
MemoryStream stream = new MemoryStream();
// Save a report to the stream.
report.SaveLayout(stream);
// Save the stream to a session.
Session["report_stream"] = stream;
}
private XtraReport RestoreReport() {
// Restore the stream from the session.
MemoryStream stream = (MemoryStream)Session["report_stream"];
// Create a report from the stream.
return XtraReport.FromStream(stream, true);
}
VB
Imports System.IO
Imports DevExpress.XtraReports.UI
' ...
Private Sub StoreReport(report As XtraReport)
' Create a stream.
Dim stream As New MemoryStream()
' Save a report to the stream.
report.SaveLayout(stream)
' Save the stream to a session.
Session("report_stream") = stream
End Sub
Private Function RestoreReport() As XtraReport
' Restore the stream from the session.
Dim stream As MemoryStream = CType(Session("report_stream"), MemoryStream)
' Create a report from the stream.
Return XtraReport.FromStream(stream, True)
End Function
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:翻譯