4.7.0 • Published 14 days ago

@slickgrid-universal/excel-export v4.7.0

Weekly downloads
8
License
MIT
Repository
github
Last release
14 days ago

License: MIT TypeScript lerna--lite npm npm

Actions Status Cypress.io jest codecov

Excel Export Service

@slickgrid-universal/excel-export

Simple Export to Excel Service that allows to exporting as .xls or .xlsx.

Internal Dependencies

External Dependencies

This package requires excel-builder-vanilla which itself also has a single dependency fflate to compress the data before sending it to the browser.

Installation

Follow the instruction provided in the main README, you can see a demo by looking at the GitHub Demo page and click on "Export to Excel" from the Context Menu or the Grid Menu (aka hamburger menu).

You can also use nearly all Excel-Builder-Vanilla options, see their Excel-Builder-Vanilla - Documentation and also take a look at Slickgrid-Universal Excel Export - Documentation on how to use both.

Usage

In order to use the Service, you will need to register it in your grid options via the registerExternalResources as shown below.

ViewModel
import { ExcelExportService } from '@slickgrid-universal/excel-export';

export class MyExample {
  initializeGrid {
    this.gridOptions = {
      enableExcelExport: true,
      excelExportOptions: {
        sanitizeDataExport: true
      },
      externalResources: [new ExcelExportService()],
    }
  }
}

If you wish to reference the service to use it with external export button, then simply create a reference while instantiating it.

import { ExcelExportService } from '@slickgrid-universal/excel-export';

export class MyExample {
  excelExportService: ExcelExportService;

  constructor() {
    this.excelExportService = new ExcelExportService();
  }

  initializeGrid {
    this.gridOptions = {
      enableExcelExport: true,
      excelExportOptions: {
        sanitizeDataExport: true
      },
      externalResources: [this.excelExportService],
    }
  }

  exportToExcel() {
    this.excelExportService.exportToExcel({ filename: 'export', format: FileType.xlsx });
  }
}

CSP (Content Security Policy)

Please note that this Excel Export service is using fflate (it compresses the data before sending it to the browser) and for better performance it uses Web Workers and for that reason you might need to adjust your CSP rules. You simply need to add a CSP rule to avoid the error worker-src 'self' blob:;

<meta http-equiv="Content-Security-Policy"
  content="default-src 'self'; ...other rules...  worker-src 'self' blob:;" />
4.7.0

14 days ago

4.6.1

1 month ago

4.6.0

1 month ago

4.5.0

2 months ago

4.4.1

3 months ago

4.4.0

3 months ago

4.3.1

3 months ago

4.3.0

3 months ago

4.2.0

4 months ago

4.1.0

4 months ago

4.0.3

5 months ago

4.0.2

5 months ago

3.7.2

5 months ago

4.0.1-alpha.1

5 months ago

4.0.1-alpha.0

5 months ago

4.0.0-alpha.0

5 months ago

3.7.1

5 months ago

3.7.0

5 months ago

3.2.2

7 months ago

3.2.1

8 months ago

3.2.0

9 months ago

3.6.0

5 months ago

3.1.0

10 months ago

3.5.1

6 months ago

3.5.0

6 months ago

3.4.0

6 months ago

3.0.1

10 months ago

3.4.2

6 months ago

3.4.1

6 months ago

3.3.0

7 months ago

3.3.2

7 months ago

3.0.0

11 months ago

3.0.0-beta.0

12 months ago

2.6.4

12 months ago

2.6.1

1 year ago

2.6.0

1 year ago

2.6.3

1 year ago

2.6.2

1 year ago

2.5.0

1 year ago

2.4.1

1 year ago

2.4.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.2.2

1 year ago

2.3.0

1 year ago

2.1.3

1 year ago

2.0.0-alpha.0

2 years ago

2.0.0

2 years ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

1.4.0

2 years ago

1.3.7

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.0

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.1

2 years ago

0.19.1

2 years ago

0.19.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

0.19.0

3 years ago

0.18.0

3 years ago

0.17.0

3 years ago

0.16.2

3 years ago

0.16.0

3 years ago

0.16.1

3 years ago

0.15.0

3 years ago

0.14.1

3 years ago

0.14.0

3 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.11.1

3 years ago

0.11.2

3 years ago

0.10.2

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.0

3 years ago

0.8.0

3 years ago

0.7.7

3 years ago

0.7.6

3 years ago

0.7.5

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.5.1

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.2.15

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.11

3 years ago

0.2.10

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.5

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.4

3 years ago

0.2.0

3 years ago

0.1.0

4 years ago