Excel Export allows you to configure the page settings for the exported Excel file.
You can customise the Excel export page settings such as page size, orientation, and margin, using the pageSetup and margins configs of the Excel Export Params. These settings are visible when printing the exported Excel file or exporting to PDF.
<ag-grid-angular
[defaultExcelExportParams]="defaultExcelExportParams"
/* other grid options ... */>
</ag-grid-angular>
this.defaultExcelExportParams = {
pageSetup: {
orientation: 'Landscape',
pageSize: 'A3'
},
margins: {
top: 1,
right: 1,
bottom: 1,
left: 1,
header: 0.5,
footer: 0.5,
}
};The value of the margins must be provided in inches.
Note the following:
pageSetup object.margins object.interface ExcelExportParams {
// ...
margins?: ExcelSheetMargin;
pageSetup?: ExcelSheetPageSetup
}Properties available on the ExcelSheetMargin interface.
Properties available on the ExcelSheetPageSetup interface.