Write XLS with Chinese Characters #553

Closed
opened 2017-02-08 13:59:45 +00:00 by keyiis · 2 comments
keyiis commented 2017-02-08 13:59:45 +00:00 (Migrated from github.com)

I want convert below data to xls,Has a simple way write it to xls by sheetjs?
#source data
head row
[‘名称’,'价格','数量']
data rows
'衣服',10,100],['帽子',10,100

I want convert below data to xls,Has a simple way write it to xls by sheetjs? #source data **head row** [‘名称’,'价格','数量'] **data rows** [['衣服',10,100],['帽子',10,100]]
SheetJSDev commented 2017-02-21 06:41:24 +00:00 (Migrated from github.com)

@keyiis check the sample file tests/write.js for how to generate a file from an array of arrays of content in nodejs.

You should only have to change the data object:

var data = [
	['名称','价格','数量'], // <-- header row
	['衣服',10,100], // <-- data row
	['帽子',10,100] // <-- data row
];

I am not entirely sure if BIFF2 (excel 2.0) supports chinese characters, but the other formats should be correct.

These are my results: https://gist.github.com/SheetJSDev/03b0717087c9e2c088b593019367fcd9

@keyiis check the sample file tests/write.js for how to generate a file from an array of arrays of content in nodejs. You should only have to change the data object: ```js var data = [ ['名称','价格','数量'], // <-- header row ['衣服',10,100], // <-- data row ['帽子',10,100] // <-- data row ]; ``` I am not entirely sure if BIFF2 (excel 2.0) supports chinese characters, but the other formats should be correct. These are my results: https://gist.github.com/SheetJSDev/03b0717087c9e2c088b593019367fcd9
SheetJSDev commented 2017-09-22 22:32:32 +00:00 (Migrated from github.com)

The new default XLS export is BIFF8 (97-2004) which does support Chinese characters!

The new default XLS export is BIFF8 (97-2004) which does support Chinese characters!
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#553
No description provided.