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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
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 |