Workbook Object工作簿对象
workbook.SheetNames
is an ordered list of the sheets in the workbook是工作簿中工作表的有序列表
wb.Sheets[sheetname]
returns an object representing the worksheet.返回表示工作表的对象。
wb.Props
is an object storing the standard properties. 是存储标准特性的对象。wb.Custprops
stores custom properties. 存储自定义特性。Since the XLS standard properties deviate from the XLSX standard, XLS parsing stores core properties in both places.由于XLS标准属性与XLSX标准不同,XLS解析在这两个位置存储核心属性。
wb.Workbook
stores workbook-level attributes.存储工作簿级属性。
File Properties文件属性
The various file formats use different internal names for file properties. 各种文件格式对文件属性使用不同的内部名称。The workbook 工作簿Props
object normalizes the names:Props
对象规范化了名称:
File Properties文件属性 (click to hide)
JS Name | |
---|---|
Title | Summary tab "Title" |
Subject | Summary tab "Subject" |
Author | Summary tab "Author" |
Manager | Summary tab "Manager" |
Company | Summary tab "Company" |
Category | Summary tab "Category" |
Keywords | Summary tab "Keywords" |
Comments | Summary tab "Comments" |
LastAuthor | Statistics tab "Last saved by" |
CreatedDate | Statistics tab "Created" |
For example, to set the workbook title property:例如,要设置工作簿标题属性:
if(!wb.Props) wb.Props = {};
wb.Props.Title = "Insert Title Here";
Custom properties are added in the workbook 自定义属性添加到工作簿Custprops
object:Custprops
对象中:
if(!wb.Custprops) wb.Custprops = {};
wb.Custprops["Custom Property"] = "Custom Value";
Writers will process the 编剧将处理选项对象的Props
key of the options object:Props
键:
/* force the Author to be "SheetJS" */
XLSX.write(wb, {Props:{Author:"SheetJS"}});
Workbook-Level Attributes工作簿级属性
wb.Workbook
stores workbook-level attributes.存储工作簿级属性。
Defined Names定义的名称
Format Support格式支持 (click to show)
Simple Defined Names简单定义的名称: XLSX/M, XLSB, BIFF8 XLS, XLML, ODS, SYLK
Unicode Defined NamesUnicode定义的名称: XLSX/M, XLSB, BIFF8 XLS, XLML, ODS
Defined Name Comment定义的名称注释: XLSX/M, XLSB, BIFF8 XLS
wb.Workbook.Names
is an array of defined name objects which have the keys:是定义的名称对象的数组,这些对象具有键:
Key | Description |
---|---|
Sheet | null (Workbook)null (工作簿) |
Name | |
Ref | "Sheet1!$A$1:$D$20" ) |
Comment |
Excel allows two sheet-scoped defined names to share the same name. Excel允许两个工作表范围的定义名称共享相同的名称。However, a sheet-scoped name cannot collide with a workbook-scope name. 但是,工作表范围的名称不能与工作簿范围名称冲突。Workbook writers may not enforce this constraint.工作簿编写器不能强制执行此约束。
Workbook Views工作簿视图
wb.Workbook.Views
is an array of workbook view objects which have the keys:是工作簿视图对象的数组,其键为:
RTL | true ,则从右向左显示 |
Miscellaneous Workbook Properties其他工作簿属性
wb.Workbook.WBProps
holds other workbook properties:保存其他工作簿属性:
CodeName | |
date1904 | 0 /false ,1904系统为1 /true |
filterPrivacy |