Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/excel-export

Package Overview
Dependencies
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/excel-export

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue


Version published
Weekly downloads
117K
increased by2.46%
Maintainers
3
Weekly downloads
 
Created

What is @ag-grid-enterprise/excel-export?

@ag-grid-enterprise/excel-export is a package that allows you to export data from AG Grid to Excel. It provides a range of features to customize the export process, including styling, formatting, and the ability to export specific data ranges.

What are @ag-grid-enterprise/excel-export's main functionalities?

Basic Export

This feature allows you to export the entire grid data to an Excel file with a single button click.

const gridOptions = { 
  columnDefs: [
    { field: 'make' },
    { field: 'model' },
    { field: 'price' }
  ],
  rowData: [
    { make: 'Toyota', model: 'Celica', price: 35000 },
    { make: 'Ford', model: 'Mondeo', price: 32000 },
    { make: 'Porsche', model: 'Boxster', price: 72000 }
  ]
};

document.querySelector('#exportButton').addEventListener('click', () => {
  gridOptions.api.exportDataAsExcel();
});

Customizing Export

This feature allows you to customize the export file name and sheet name.

const gridOptions = { 
  columnDefs: [
    { field: 'make' },
    { field: 'model' },
    { field: 'price' }
  ],
  rowData: [
    { make: 'Toyota', model: 'Celica', price: 35000 },
    { make: 'Ford', model: 'Mondeo', price: 32000 },
    { make: 'Porsche', model: 'Boxster', price: 72000 }
  ]
};

document.querySelector('#exportButton').addEventListener('click', () => {
  gridOptions.api.exportDataAsExcel({
    fileName: 'custom_export.xlsx',
    sheetName: 'Custom Sheet'
  });
});

Styling Cells

This feature allows you to apply custom styles to specific cells during the export process.

const gridOptions = { 
  columnDefs: [
    { field: 'make' },
    { field: 'model' },
    { field: 'price' }
  ],
  rowData: [
    { make: 'Toyota', model: 'Celica', price: 35000 },
    { make: 'Ford', model: 'Mondeo', price: 32000 },
    { make: 'Porsche', model: 'Boxster', price: 72000 }
  ],
  defaultExcelExportParams: {
    processCellCallback: (params) => {
      if (params.column.getColId() === 'price') {
        return { value: params.value, style: { font: { bold: true } } };
      }
      return params.value;
    }
  }
};

document.querySelector('#exportButton').addEventListener('click', () => {
  gridOptions.api.exportDataAsExcel();
});

Other packages similar to @ag-grid-enterprise/excel-export

Keywords

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc