0
votes

How to set column width in the excel for certain columns?

I tried the following but not working.

  this.gridOptions.excelStyles = this.excelStyles;
  let params = {
    fileName: 'DelegateStatus',
    sheetName: 'Delegate Status',
    columnWidth: 10        
  }
  this.gridOptions.api.exportDataAsExcel(params);

Thanks

1

1 Answers

0
votes

Your approach using columnWidth is correct however,

columnWidth was introduced in version 22.1.0

AG-1486 [Feature Request] 22.1.0 Allow configuring row groups/cells when exporting to excel/csv

What is the ag-grid version you are using?