Home Forums WinForms controls Xceed Grid for WinForms report printpreview maximized Reply To: report printpreview maximized

User (Old forums)
Member
Post count: 23064

There is no way to set the PrintDialog size using the PrintPreview method. However, PrintPreview is only a shortcut. You could do the whole process yourself. Here’s an example in C#. It assumes that you have a PrinterSettings instance.

<i>
using( PrintDocument document = this.CreatePrintDocument() )
{
// Bypass the built-in progression dialog
document.PrintController = new StandardPrintController();
document.PrinterSettings = ( PrinterSettings )printerSettings.Clone();
document.DefaultPageSettings = ( PageSettings )printerSettings.DefaultPageSettings.Clone();

using( System.Windows.Forms.PrintPreviewDialog printPrvDlg = new System.Windows.Forms.PrintPreviewDialog() )
{
printPrvDlg.Document = document;
printPrvDlg.WindowState = System.Windows.Forms.FormWindowState.Maximized;
printPrvDlg.ShowDialog();
}
}
</i>

Imported from legacy forums. Posted by André (had 230 views)