Skip to content

Commit 3b2b8ca

Browse files
committed
Update the README and documentation for the data validation functions
1 parent 4957ee9 commit 3b2b8ca

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## Introduction
1515

16-
Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.16 or later. The full docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/xuri/excelize/v2) and [docs reference](https://xuri.me/excelize/).
16+
Excelize is a library written in pure Go providing a set of functions that allow you to write to and read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and writing spreadsheet documents generated by Microsoft Excel™ 2007 and later. Supports complex components by high compatibility, and provided streaming API for generating or reading data from a worksheet with huge amounts of data. This library needs Go version 1.16 or later. There are some [incompatible changes](https://github.com/golang/go/issues/61881) in the Go 1.21.0, the Excelize library can not working with that version normally, if you are using the Go 1.21.x, please upgrade to the Go 1.21.1 and later version. The full docs can be seen using go's built-in documentation tool, or online at [go.dev](https://pkg.go.dev/github.com/xuri/excelize/v2) and [docs reference](https://xuri.me/excelize/).
1717

1818
## Basic Usage
1919

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## 简介
1515

16-
Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的电子表格文档。支持 XLAM / XLSM / XLSX / XLTM / XLTX 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写函数,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。使用本类库要求使用的 Go 语言为 1.16 或更高版本,完整的使用文档请访问 [go.dev](https://pkg.go.dev/github.com/xuri/excelize/v2) 或查看 [参考文档](https://xuri.me/excelize/)
16+
Excelize 是 Go 语言编写的用于操作 Office Excel 文档基础库,基于 ECMA-376,ISO/IEC 29500 国际标准。可以使用它来读取、写入由 Microsoft Excel™ 2007 及以上版本创建的电子表格文档。支持 XLAM / XLSM / XLSX / XLTM / XLTX 等多种文档格式,高度兼容带有样式、图片(表)、透视表、切片器等复杂组件的文档,并提供流式读写函数,用于处理包含大规模数据的工作簿。可应用于各类报表平台、云计算、边缘计算等系统。使用本类库要求使用的 Go 语言为 1.16 或更高版本,请注意,Go 1.21.0 中存在[不兼容的更改](https://github.com/golang/go/issues/61881),导致 Excelize 基础库无法在该版本上正常工作,如果您使用的是 Go 1.21.x,请升级到 Go 1.21.1 及更高版本。完整的使用文档请访问 [go.dev](https://pkg.go.dev/github.com/xuri/excelize/v2) 或查看 [参考文档](https://xuri.me/excelize/)
1717

1818
## 快速上手
1919

datavalidation.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,12 @@ func (dv *DataValidation) SetInput(title, msg string) {
112112
dv.Prompt = &msg
113113
}
114114

115-
// SetDropList data validation list.
115+
// SetDropList data validation list. If you type the items into the data
116+
// validation dialog box (a delimited list), the limit is 255 characters,
117+
// including the separators. If your data validation list source formula is
118+
// over the maximum length limit, please set the allowed values in the
119+
// worksheet cells, and use the SetSqrefDropList function to set the reference
120+
// for their cells.
116121
func (dv *DataValidation) SetDropList(keys []string) error {
117122
formula := strings.Join(keys, ",")
118123
if MaxFieldLength < len(utf16.Encode([]rune(formula))) {
@@ -162,9 +167,12 @@ func (dv *DataValidation) SetRange(f1, f2 interface{}, t DataValidationType, o D
162167
// SetSqrefDropList provides set data validation on a range with source
163168
// reference range of the worksheet by given data validation object and
164169
// worksheet name. The data validation object can be created by
165-
// NewDataValidation function. For example, set data validation on
166-
// Sheet1!A7:B8 with validation criteria source Sheet1!E1:E3 settings, create
167-
// in-cell dropdown by allowing list source:
170+
// NewDataValidation function. There are limits to the number of items that
171+
// will show in a data validation drop down list: The list can show up to show
172+
// 32768 items from a list on the worksheet. If you need more items than that,
173+
// you could create a dependent drop down list, broken down by category. For
174+
// example, set data validation on Sheet1!A7:B8 with validation criteria source
175+
// Sheet1!E1:E3 settings, create in-cell dropdown by allowing list source:
168176
//
169177
// dv := excelize.NewDataValidation(true)
170178
// dv.Sqref = "A7:B8"

styles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ func (f *File) extractProtection(xf xlsxXf, s *xlsxStyleSheet, style *Style) {
13021302
}
13031303
}
13041304

1305-
// GetStyle get style details by given style index.
1305+
// GetStyle provides a function to get style definition by given style index.
13061306
func (f *File) GetStyle(idx int) (*Style, error) {
13071307
var style *Style
13081308
f.mu.Lock()

0 commit comments

Comments
 (0)