Pular para o conteúdo principal

Export

A sub namespace of Utils, exclusive for export operations


toWorksheet

Description

This method can be used to export data into an excel sheet.

Method(s)

1    function toWorksheet(data: object[], fileName: string, sheetName: string = undefined)
ParameterTypeRequiredDefaultsDescription
dataobject[]trueData to export
fileNamestringtrueName for the exported file
sheetNamestringfalseName for the sheet

Basic Usage

SW.Utils.Export.toWorksheet(['One', 'Two'], 'TestName', 'SheetTestName');

Response

This method will download a xlsx file named "TestName" with the data given in a sheet with the name "SheetTestName".


toCsv

Description

This method can be used to export data into an excel sheet.

Method(s)

1    function toCsv(options: ExportOption, data: any): void
ParameterTypeRequiredDefaultsDescription
optionsExportOptionfalseExport options
dataanyfalseData to export

Basic Usage

SW.Utils.Export.toCsv({filename: 'TestName'}, ['One', 'Two'])

Response

This method will download a csv file named "TestName" with the data given.