Ignite UI for Angular CSV Exporter Service - Documentation

The Ignite UI for Angular CSV Exporter service can export data in a Character Separated Values format from both raw data (array) or from an IgxGrid.

Example:

public localData = [
  { Name: "Eric Ridley", Age: "26" },
  { Name: "Alanis Brook", Age: "22" },
  { Name: "Jonathan Morris", Age: "23" }
];

constructor(private csvExportService: IgxCsvExporterService) {
}

const opt: IgxCsvExporterOptions = new IgxCsvExporterOptions("FileName", CsvFileTypes.CSV);
this.csvExportService.exportData(this.localData, opt);

IgxCsvExporterService

new IgxCsvExporterService(): IgxCsvExporterService

Returns IgxCsvExporterService

Inherited from: IgxBaseExporter

This event is emitted when a column is exported.

this.exporterService.columnExporting.subscribe((args: IColumnExportingEventArgs) => {
// put event handler code here
});
columnExporting: EventEmitter<IColumnExportingEventArgs>

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/base-export-service.ts:200

This event is emitted when the export process finishes.

this.exporterService.exportEnded.subscribe((args: ICsvExportEndedEventArgs) => {
// put event handler code here
});
exportEnded: EventEmitter<ICsvExportEndedEventArgs>

Defined in projects/igniteui-angular/grids/core/src/services/csv/csv-exporter.ts:50

Inherited from: IgxBaseExporter

This event is emitted when a row is exported.

this.exporterService.rowExporting.subscribe((args: IRowExportingEventArgs) => {
// put event handler code here
});
rowExporting: EventEmitter<IRowExportingEventArgs>

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/base-export-service.ts:188

Inherited from: IgxBaseExporter

Method for exporting IgxGrid component's data.

this.exporterService.export(this.igxGridForExport, this.exportOptions);
export(grid: GridTypeBase, options: IgxExporterOptionsBase): void

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/base-export-service.ts:227

Parameters

Returns void

Inherited from: IgxBaseExporter

Method for exporting any kind of array data.

this.exporterService.exportData(this.arrayForExport, this.exportOptions);
exportData(data: any[], options: IgxExporterOptionsBase): void

Defined in projects/igniteui-angular/grids/core/src/services/exporter-common/base-export-service.ts:286

Parameters

Returns void