Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Addon that encapsulates ability to render a data set as either excel or csv.

License

Notifications You must be signed in to change notification settings

IZEA/ember-cli-data-export

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ember-cli-data-export

Addon that encapsulates ability to render a data set as either excel or csv.

  • ember install @izea/ember-cli-data-export

Usage

  • uses js-xlsx library for rendering excel content.
  • automatically injects a service for both excel and csv format
  • feed a datastructure that's an array of arrays, where each internal array is the set of data to be rendered for that row.
  • Example: [['Title 1', 'Title 2', 'Title 3'],['row1cell1', 'row1cell2', 'row1cell3'],['row2cell1', 'row2cell2', 'row2cell3']]

Example

var data = [
  ['Title 1', 'Title 2', 'Title 3'],
  ['row1cell1', 'row1cell2', 'row1cell3'],
  ['row2cell1', 'row2cell2', 'row2cell3'],
];

if (type === 'Excel') {
  this.get('excel').export(data, { sheetName: 'sheet1', fileName: 'test.xlsx' });
} else if (type === 'CSV') {
  this.get('csv').export(data, { fileName: 'test.csv' });
}

About

Addon that encapsulates ability to render a data set as either excel or csv.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 85.3%
  • HTML 10.7%
  • Handlebars 4.0%