1.1.0 • Published 12 months ago

@nitra/export-excel v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@nitra/export-excel

import { exportFile, date } from 'quasar'
import { exportToExcel } from '@nitra/export-excel'

const columns = [
  {
    label: '#',
    field: 'id',
    align: 'center',
    width: 10
  },
  {
    label: 'Test',
    field: 'created',
    align: 'right',
    width: 15
  }
]

const rows = [
  {
    id: 1,
    created: date.formatDate(new Date(), 'DD.MM.YYYY HH:mm')
  },
  {
    id: 2,
    created: date.formatDate(new Date(), 'DD.MM.YYYY HH:mm')
  }
]

const buffer = await exportToExcel(columns, rows, 'buffer')

exportFile(`test.xlsx`, buffer, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
1.1.0

12 months ago

1.0.0

3 years ago