windowsforms-devexpress-dot-xtraprinting-dot-printtool-a54c6e09.md
Provides access to a Print Preview form of the PrintTool.
Namespace : DevExpress.XtraPrinting
Assembly : DevExpress.XtraPrinting.v25.2.dll
NuGet Package : DevExpress.Win.Printing
public PrintPreviewFormEx PreviewForm { get; }
Public ReadOnly Property PreviewForm As PrintPreviewFormEx
| Type | Description |
|---|---|
| PrintPreviewFormEx |
A PrintPreviewFormEx object.
|
The example below illustrates how to define a document scale factor in the Print Preview.
using System;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting.Preview;
// ...
private void button1_Click(object sender, EventArgs e) {
ReportPrintTool printTool = new ReportPrintTool(new XtraReport1());
printTool.PreviewForm.Load += new EventHandler(PreviewForm_Load);
printTool.ShowPreviewDialog();
}
void PreviewForm_Load(object sender, EventArgs e) {
PrintPreviewFormEx frm = (PrintPreviewFormEx)sender;
frm.PrintingSystem.ExecCommand(PrintingSystemCommand.Scale, new object[] { 0.7f });
}
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraPrinting.Preview
' ...
Private Sub button1_Click(ByVal sender As Object, _
ByVal e As EventArgs) Handles button1.Click
Dim printTool As New ReportPrintTool(New XtraReport1())
AddHandler printTool.PreviewForm.Load, AddressOf PreviewForm_Load
printTool.ShowPreviewDialog()
End Sub
Private Sub PreviewForm_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim frm As PrintPreviewFormEx = CType(sender, PrintPreviewFormEx)
frm.PrintingSystem.ExecCommand(PrintingSystemCommand.Scale, New Object() { 0.7f })
End Sub
See Also