Export the Excel plug-in with format msexcel-builder,

Source: Internet
Author: User
Tags install node

Export the Excel plug-in with format msexcel-builder,

MSExcel generator (msexcel-builder)

A small library is used to create Nodejs under the Microsoft Office Excel (2007) file.

A simple and quick library to create an Office Excel (> 2007) xlsx file (compatible with the OpenOffice document format ).

Features:

Supports workbooks with multiple worksheets.

Customize the column width and row height, and merge cells.

Customize the cell style (such as the background color ).

Customize the cell border style (such as thin and medium ).

Customize the font style of cells (such as font and bold ).

Customize cell border styles and merged cells.


First, install node. js.

Then install it in node. js:

npm install msexcel-builder

Create a workbook with data.

  // Create a new workbook file in current working-path   var workbook = excelbuilder.createWorkbook('./', 'sample.xlsx')    // Create a new worksheet with 10 columns and 12 rows   var sheet1 = workbook.createSheet('sheet1', 10, 12);    // Fill some data   sheet1.set(1, 1, 'I am title');  for (var i = 2; i < 5; i++)    sheet1.set(i, 1, 'test'+i);    // Save it   workbook.save(function(ok){    if (!ok)       workbook.cancel();    else      console.log('congratulations, your workbook created');  });
Link: https://www.npmjs.com/package/msexcel-builder





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.