当前位置:网站首页>Change of sheetname
Change of sheetname
2022-07-24 08:32:00 【lvxinaidou】
- npm i xlsx
npm i xlsx
package.json There's more than one ,
"xlsx": "^0.17.2"
- quote
import {
saveAs } from 'file-saver';
import {
utils, write } from 'xlsx';
- Use sheetName This is the name to be changed
exportExcel() {
const worksheet = utils.json_to_sheet(this.getExcelData());
const workbook = {
Sheets: {
data: worksheet }, SheetNames: ['data'] };
const excelBuffer: any = write(workbook, {
bookType: 'xlsx',
type: 'array',
});
this.saveAsExcelFile(excelBuffer, 'AgrregatedIssueUpdates');
}
saveAsExcelFile(buffer: any, fileName: string): void {
let EXCEL_TYPE =
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
let EXCEL_EXTENSION = '.xlsx';
const data: Blob = new Blob([buffer], {
type: EXCEL_TYPE,
});
saveAs(
data,
fileName + '_export_' + new Date().getTime() + EXCEL_EXTENSION
);
}
边栏推荐
- Golang implements sanggi diagram and analyzes user behavior trajectory
- Wxml template concise tutorial
- JS to get the default language of the current browser
- Assembly | screen display numbers
- Is it safe to open an account online in Beijing
- Shared lock, exclusive lock, mutex lock, pessimistic lock, optimistic lock, row lock, table lock, page lock, non repeatable read, lost modification, read dirty data
- Svg from entry to regret, why not learn it earlier (graphic version)
- Classic problems of binary tree
- WXS syntax reference -wxs module
- You can't access this shared folder because your organization's security policies prevent unauthenticated guests from accessing it. These policies can help protect your computer from unsafe or malicio
猜你喜欢

2022.7.11全盘题解

SVG 从入门到后悔,怎么不早点学起来(图解版)

「题解」带分数

M-dao creates a one-stop Dao platform, allowing hundreds of millions of players to join Dao space

Musk responded that the brain has been uploaded to the cloud: already did it!

【一起上水硕系列】Final RAD-new literacies

Wargames NATAS (0-10) problem solving essay

Local warehouse associated with remote warehouse

Web3 traffic aggregation platform starfish OS interprets the "p2e" ecosystem of real business

Install SQL Server database
随机推荐
情人节
Ansible automatic operation and maintenance
Recursive performance test
Is gamefi in decline or in the future?
Four data interaction modes of go grpc
[wechat applet development (III)] realize the stacking and sliding of cards
[wechat applet development (native)] canvas animation
In 2022, how to choose cross end technology solutions?
Advantages and disadvantages of redis and ZK implementing distributed locks
[internationalization] decimal point and comma of application development
FPGA integrated project - image edge detection system
Kotlin learning note 1 - variables, functions
WordPress free theme: document, making reading more convenient
[Linux] Oracle VirtualBox installation CentOS 8
Wargames bandit (11-20) problem solving essay
Digital collections are both outlets and risks!
Precautions for using kettle excel input
「题解」蝙蝠侠的麻烦
国产“火箭心”人工心脏上市 不同人工心脏有什么区别?
Is it safe to open an account online in Beijing