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)
Parameter | Type | Required | Defaults | Description |
---|---|---|---|---|
data | object[] | true | Data to export | |
fileName | string | true | Name for the exported file | |
sheetName | string | false | Name 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
Parameter | Type | Required | Defaults | Description |
---|---|---|---|---|
options | ExportOption | false | Export options | |
data | any | false | Data 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.