ComponentOne flexgrid Export to PDF

Posted by: rambabu on 2 June 2023, 7:16 am EST

  • Posted 2 June 2023, 7:16 am EST

    Hello Can you please let me know how to export the Flexgrid to PDF. I checked in the samples in the Componentone Samples Explorer and the columns are splitting into multiple pages instead of showing on a single page. please refer to the attached PDF.

    Code I am using

    await grid.SaveAsync(dlg.FileName,

    “FlexGrid Sheet”,

    SaveFileFormat.Pdf,

    new GridRowColRanges(txtRowRanges.Text, rows),

    new GridRowColRanges(txtColRanges.Text, columns),

    headers,

    merged: checkMerged.IsChecked ?? false,

    formatted: checkFormatted.IsChecked ?? false,

    renderImages: checkRenderImages.IsChecked ?? false);

  • Posted 2 June 2023, 7:17 am EST

    This is the PDFtesthfdghv.zip

  • Posted 4 June 2023, 11:02 pm EST - Updated 4 June 2023, 11:08 pm EST

    Hi Rambabu,

    In order to implement export to PDF functionality, you can refer to “Printing” sample present at the location: “C:\Users<user-name>\Documents\ComponentOne Samples\WPF\v6.0\CS\Grid”.

    This sample demonstrates the use of Print method to print the grid. This method has three overloads which takes parameters that allow you to specify the document name, page margins, scaling, maximum number of pages to print, and print parameters. For more information, please refer here: https://www.grapecity.com/componentone/docs/wpf/online-flexgrid/AdvancedPrinting.html

    The application contains an expander named “Settings” to set the print parameters. When you set “Zoom” to “Page Width”, it prints all the columns of the flexgrid on a single page. Basically, you can set ScaleMode property of GridPrintParameters to “PageWidth” and pass this parameter instance to the Flexgrid’s Print method.

    We are attaching the sample application for your reference. Please check Printing.zip

    Thanks & Regards,

    Aastha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels