原創|其它|編輯:郝浩|2012-11-20 12:00:38.000|閱讀 8538 次
概述:本實例顯示了使用DevExprese子控件XtraReport如何在打印預覽窗體中顯示報表的具體方法。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
作為2012Visual Studio Magazine讀者選擇獎金獎報表類金獎獲得者,DevExprese子控件XtraReports Suite是一個跨平臺報表工具,在Windows Forms、ASP.NET、ASP.NET MVC、WPF、Silverlight、LightSwitch等開發環境下都能有優異的表現。本實例顯示了使用DevExprese子控件XtraReport如何在打印預覽窗體中顯示報表的具體方法。
C#
using System;
using System.Windows.Forms;
using DevExpress.LookAndFeel;
using DevExpress.XtraReports.UI;
// ...
private void Form1_Load(object sender, EventArgs e) {
XtraReport1 report = new XtraReport1();
ReportPrintTool printTool = new ReportPrintTool(report);
// Invoke the Print Preview form modally,
// and load the report document into it.
printTool.ShowPreviewDialog();
// Invoke the Print Preview form
// with the specified look and feel setting.
printTool.ShowPreview(UserLookAndFeel.Default);
}
VB
Imports System
Imports System.Windows.Forms
Imports DevExpress.LookAndFeel
Imports DevExpress.XtraReports.UI
' ...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Dim report As New XtraReport1()
Dim printTool As New ReportPrintTool(report)
' Invoke the Print Preview form modally,
' and load the report document into it.
printTool.ShowPreviewDialog()
' Invoke the Print Preview form
' with the specified look and feel setting.
printTool.ShowPreview(UserLookAndFeel.Default)
End Sub
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@ke049m.cn
文章轉載自:慧都控件網