For Vue programmers, a great excel file creation library with full format is required. It's Excel4node.
Excel4node is a node.js module that allows you to create and manipulate Microsoft Excel spreadsheets.
It's easy to use as generating Excel files with complex formatting, formulas, and charts, hide sheet, protection sheet,...
Strength
1. Simple: it is simple to makes it easy to generate Excel files in just a few lines of code.
2. Formulas: can add and edit formulas in your spreadsheet.
3. Charts: can create charts and graphs in your Excel files.
4. Flexibility: allows to create and modify Excel files with a variety of formatting options, including cell alignment, font style and color, and background color.
Weakness
1. Read: don't support function read file in lib, must use other lib to read.
2. Environment: some time, when export at other environment and get it to read have problem.
Demo
I would like to show you how to use it in Vuejs.
The first : We need to install package excel4node
+ Open cmd of windows and go to project: I use project Demo in here D:\.
cmd : D:\Demo\web>npm i excel4node
+ Import the library into the project : To use this library, We need import it to project.
// Require library
var xl = require('excel4node');
+ Create file excel with sheet name [sheet 1] with 5 column and 3 row have special template
+ Create css common apply for excel : border color 000000, style thin , font-size = 11, font family MS PGothic
+ Apply column B to column F , Line 2 to line 5
// Apply
ws1.cell(2, 2, 5, 6, false).style(styleBorder)
+ Add data to column
B2 : D2 : |
+ Finally we will get the excel file as expected :
- Column B to column F , line 2 to line 5 : have border
- Column B to column E , line 2 to line 5 : have background #fcd5b4
- Column B and column C , line 2 have text data as format
[Reference Source]
https://www.npmjs.com/package/excel4node
https://assets-global.website-files.com/603fbb650184a06b268ce08b/62eeaa4f06d84810c1b8a22c_excel-project-plan-templates-p-1600.jpg