This example demonstrates how to use the DevExpress Printing Library to show a Print Preview for a document loaded into a Workbook instance (workbook, in this example). To do this, follow the steps below:
using DevExpress.Spreadsheet;
using DevExpress.XtraPrinting;
// Invoke the Print Preview dialog for the workbook.
using (PrintingSystem printingSystem = new PrintingSystem()) {
using (PrintableComponentLink link = new PrintableComponentLink(printingSystem)) {
link.Component = workbook;
link.CreateDocument();
link.ShowPreviewDialog();
}
}
Imports DevExpress.Spreadsheet
Imports DevExpress.XtraPrinting
' Invoke the Print Preview dialog for the workbook.
Using printingSystem As New PrintingSystem()
Using link As New PrintableComponentLink(printingSystem)
link.Component = workbook
link.CreateDocument()
link.ShowPreviewDialog()
End Using
End Using
See Also