This example demonstrates how to export detail sections of a master-detail report to separate Excel sheets.
The report contains information about product categories. The name and description of each category are bound to the controls in the Detail band. The name and price of each product are bound to the controls in the DetailReport band.
On Print Preview, product categories span across one or two report pages. To export each product category to a separate sheet of an Excel file, do the following:
- Set the DetaiReport band's PageBreak property to AfterBand to print each product category on a new report page.
- Set the report's RollPaper property to true to fit each product category to one report page.
- Set the ExportMode property to Single File Page By Page to export each page of the report to a separate Excel sheet.
- (Optional) Use the XlSheetCreated event to change the default name of each sheet to the category name.
-
XtraReport1.cs (VB: XtraReport1.vb)
(you will be redirected to DevExpress.com to submit your response)