-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Plugin: Export XLSX
EN 【中文文档在下方】
Luckysheet export as XLSX file, the front end passes in the Luckysheet json, and the back end returns the XLSX file stream.
Online experience address: Luckysheet Export Demo
The following Luckysheet configurations already support exporting to xlsx files
sheet.data[row][column]
- v: the original value of the content
- bg: background
- ff: font
- fc: font color
- bl: bold font
- it: font italic
- fs: font size
- cl: enable strikethrough
- ht: center horizontally
- vt: vertical center
- tr: text rotation
- tb: Text word wrapping
- ct: number format
- f: formula (Dynamic arrays do not support)
- ps: comments
- rich text
- sheet.defaultRowHeight: default row height
- sheet.defaultColWidth: default column width
- sheet.hyperlink: hyperlink
- sheet.images: images (fixed positioning not supported)
- sheet.chart: chart (as image)
- sheet.zoomRatio: zoom ratio
- sheet.hide: whether to hide
- sheet.name: name
- sheet.frozen: Freeze
- sheet.filter_select: auto filter (only supports range)
- sheet.color: tab color
- sheet.config.borderInfo: border
- sheet.config.merge: merge cells
- sheet.config.rowlen: row height
- sheet.config.columnlen: column width
- sheet.config.rowhidden: hide rows
- sheet.config.colhidden: Hidden columns
- sheet.config.authority: sheet protection
- scaling ratio
- hide
- sheet name
- Freeze
- autofilter (only ranges are supported)
Download the export plug-in compressed package, unzip the executable file lucky-export-linux and the temporary License file SecretKey.txt, which can be used to deploy to the linux server
Address: Luckysheet Plugin Download
Use an FTP tool such as FileZilla to transfer the lucky-export-linux and SecretKey.txt files to any empty directory on the server, such as the /software/lucky directory
Fix Permission denied issue
cd /software/lucky
chmod 777 lucky-export-linuxstartup parameters
- -p: port, [optional]
- -c: cross-domain settings, the domain name to open access, [optional]
linux
cd /software/lucky
# Run the test directly in the current window, -p can change the port as needed
./lucky-export-linux -p 3001
# Keep running in the background
nohup ./lucky-export-linux -p 3001
>lucky-export-linux.out 2>&1 &After execution, Ctrl+C can exit the interaction
Check whether the startup is successful
ps aux | grep lucky-export-linuxThe Luckysheet front-end configuration opens the export button in the toolbar to ensure that the Luckysheet latest code on Github is packaged
luckysheet. create({
plugins:[{
name: 'exportXlsx',
config:{
url:'http://[YOUR_SERVER_IP]:3001/luckyToXlsx'
}
}]
})Among them, you need to update your own server interface address url
After the experience is complete, please contact sales to purchase a permanent license in time. Replace the License file SecretKey.txt and restart the service to take effect.
ZH
Luckysheet导出为XLSX文件,前端传入Luckysheet json,后端返回XLSX文件流。
在线体验地址:Luckysheet 导出 Demo
以下Luckysheet的配置已支持导出到xlsx文件
sheet.data[row][column]
- v: 内容的原始值
- bg: 背景
- ff: 字体
- fc: 字体颜色
- bl: 字体加粗
- it: 字体斜体
- fs: 字体大小
- cl: 启用删除线
- ht: 水平居中
- vt: 垂直居中
- tr: 文字旋转
- tb: 文本自动换行
- ct: 数字格式
- f: 公式(动态数组不支持)
- ps: 批注
- 富文本
- sheet.defaultRowHeight:默认行高
- sheet.defaultColWidth:默认列宽
- sheet.hyperlink:超链接
- sheet.frozen:冻结
- sheet.filter:筛选
- sheet.dataVerification:数据验证
- sheet.images:图片(固定定位不支持)
- sheet.chart:图表(作为图片)
- sheet.zoomRatio:缩放比例
- sheet.hide:是否隐藏
- sheet.name: 名称
- sheet.frozen:冻结
- sheet.filter_select:自动筛选(只支持范围)
- sheet.color: sheet标签颜色
- sheet.config.borderInfo:边框
- sheet.config.merge:合并单元格
- sheet.config.rowlen:行高
- sheet.config.columnlen:列宽
- sheet.config.rowhidden:隐藏行
- sheet.config.colhidden:隐藏列
- sheet.config.authority:工作表保护
下载导出插件压缩包,解压出可执行文件 lucky-export-linux 和 临时 License 文件 SecretKey.txt,可用于部署到linux服务器上
使用 FTP 工具比如 FileZilla,传输 lucky-export-linux 和 SecretKey.txt 文件到服务器任意空白目录,比如/software/lucky目录下
修复 Permission denied 问题
cd /software/lucky
chmod 777 lucky-export-linux启动参数
- -p: 端口,[可选]
- -c: 跨域设置,要开放访问的域名,[可选]
linux
cd /software/lucky
# 当前窗口直接运行测试,-p 可以根据需要更改端口
./lucky-export-linux -p 3001
# 保持后台运行
nohup ./lucky-export-linux -p 3001 >lucky-export-linux.out 2>&1 &执行后 Ctrl+C 退出交互即可
查询是否启动成功
ps aux|grep lucky-export-linuxLuckysheet前端配置开启工具栏的导出按钮,确保打包Github上 Luckysheet最新代码
luckysheet.create({
plugins:[{
name:'exportXlsx',
config:{
url:'http://[YOUR_SERVER_IP]:3001/luckyToXlsx'
}
}]
})其中需要更新自己服务器接口地址url
体验完成之后,请及时联系销售购买永久License。替换 License 文件 SecretKey.txt 重启服务即可生效。