How to Export Each Grid Group on a Single Page
Environment
Product Version | Product | Author |
---|---|---|
2020.1.113 | RadGridView for WinForms | Desislava Yordanova |
Description
By default, GridViewPdfExport is not intended to export the groups in RadGridView on separate pages. Hence, it doesn't provide a public API for achieving this behavior.
This article aims to demonstrates a sample approach how each group can be exported on a single PDF page.
Solution
Iterate all groups in the original RadGridView and create a dummy grid for each group which is populated with the rows for the respective group. Then, add a GroupDescriptor to the dummy grid and export it to PDF. Thus, you will have N number of PDF files each containing the respective group with the group rows.
Eventually, if you want to combine all pages into one PDF document, using a PdfStreamWriter is a suitable approach: