Small library for generate xls files via Webworker
import { NgModule } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { ExcelBuilderModule } from '@angular-ru/ng-excel-builder';
@NgModule({
imports: [TranslateModule.forRoot(), ExcelBuilderModule]
})
export class AppModule {}
This builder we made for simple and fast generation xls files on client-side. It works with small & medium data size. Files wil open only in Microsoft Excel(!). Google Spreadsheets, LibreOffice and another programs are not supported.
$ npm install @angular-ru/ng-excel-builder --save
import { Component } from '@angular/core';
import { ExcelService } from '@angular-ru/ng-excel-builder';
@Component()
export class AppComponent {
public data = [
{
id: 'id',
name: 'Maria',
description: 'Fugiat tempor sunt nostrud ad fugiat. Laboris velit duis incididunt culpa',
...
},
{...}
];
constructor(protected excel: ExcelService) {}
public exportExcel(): void {
this.excel.exportExcel({
filename: 'TITLE',
worksheets: [
{
titleKey: 'MODEL_KEY_NAME',
worksheetName: 'worksheet name',
table: this.data
}
],
translateColumns: { // Example by RU
MODEL_KEY_NAME: {
id: 'id',
name: 'Имя',
description: 'Описание'
}
}
});
}
}
Author: Angular-RU
Demo: https://angular-ru.github.io/angular-ru-excel-example-app/
Source Code: https://github.com/Angular-RU/angular-ru-excel-example-app
#angularjs #javascript #angular