Home Forums WinForms controls Xceed Grid for WinForms report printpreview maximized

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14612 |

    Hello!
    I am creating a report by code – that works fine –
    but I want that the window (of the reportpreview) is maximized.
    here my code:

    Dim report As Report = New Report(Me.GridControl1)
    Dim printerSettings As New PrinterSettings
    printerSettings.DefaultPageSettings.Landscape = True
    report.PrintPreview(printerSettings)

    Thanks
    VUser

    Imported from legacy forums. Posted by VUser (had 3634 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m not sure I understand what you need. Can you give me more details? Are you trying to have the form maximized? At worst if you need to send screenshot or more details, you can contact me at matt@xceedsoft.com

    Imported from legacy forums. Posted by Matt (had 185 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello,
    Sorry for anwering so late – I was in holidays… –
    you can see, what I mean in the XCEED-sample VB.Net Reporting, form Gridreporting.vb:
    if you click on the Button ‘Generate Code Report’,
    a new window opens the report, but too small;
    I want that the report opens maximized.

    Thanks!
    VUser

    Imported from legacy forums. Posted by VUser (had 564 views)

    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)

    User (Old forums)
    Member
    Post count: 23064

    Hello!
    Thanks a lot for your help!
    it was exactly what I needed!

    Imported from legacy forums. Posted by VUser (had 4347 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.