Skip to content

Commit 33eb3ca

Browse files
committed
Document AutoFilter write behavior and defaults
1 parent 8193c58 commit 33eb3ca

6 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ Dynamic schemas are the union of row keys in first-seen order. Missing values ar
227227

228228
New worksheets freeze the first physical row by default for MiniExcel v1 compatibility. Configure physical row and column counts with `with_freeze_row_count()` and `with_freeze_column_count()`; set both to `0` to disable frozen panes.
229229

230+
AutoFilter dropdowns cover the complete written range by default, including header-only exports. Use `with_auto_filter(false)` to disable them. When headers are disabled, Excel treats the first data row as the filter-header row.
231+
230232
Create multiple worksheets in input order with `MiniExcel::save_as_sheets()`. It returns one data-row count per worksheet:
231233

232234
```rust

README.zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ MiniExcel::save_as_with_options(
227227

228228
为兼容 MiniExcel v1,新 worksheet 默认冻结第一个物理 row。使用 `with_freeze_row_count()``with_freeze_column_count()` 配置物理行列数;两者都设为 `0` 可关闭冻结窗格。
229229

230+
AutoFilter 下拉菜单默认覆盖完整写入范围,包括只有 header 的导出。使用 `with_auto_filter(false)` 可关闭。禁用 header 时,Excel 会把第一个数据 row 当作筛选标题行。
231+
230232
使用 `MiniExcel::save_as_sheets()` 可按输入顺序创建多个工作表;返回值是每张工作表的数据行数:
231233

232234
```rust

docs/compatibility.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ The latest `calamine 0.36` and `rust_xlsxwriter 0.97` require Rust 1.88. The MVP
4848
| Multi-sheet export | `save_as_sheets()` / `save_as_serialized_sheets()` | Preserves input sheet order and returns data-row counts |
4949
| `overwriteFile` | `WriteOptions::with_overwrite_file()` | Defaults to `false`; existing paths require explicit opt-in |
5050
| `FreezeRowCount` / `FreezeColumnCount` | `WriteOptions::with_freeze_row_count()` / `with_freeze_column_count()` | Defaults to one frozen row and zero frozen columns |
51+
| `AutoFilter` | `WriteOptions::with_auto_filter()` | Defaults to `true`; covers the complete written range |
5152
| Basic template fill | `save_as_template()` / `save_as_template_bytes()` | Scalar placeholders and single-row array expansion; preserves package parts |
5253

5354
`MiniExcel` is the only public behavior entry point. Reader, writer, parser, and concrete iterator types are crate-internal. Public supporting types are limited to row/cell values, structured provenance rows, options, errors/results, and Serde date/time helpers.
@@ -116,7 +117,7 @@ Rust integration tests reuse the repository's existing files under `tests/data/x
116117
- Forced shared-string disk spill, indexed lookup, invalid-directory handling, memory-only byte queries, and early-drop cleanup.
117118
- Structured formula text, cached values, A1 addresses, style IDs, built-in/custom number formats, ranges, and early iterator drop.
118119

119-
Writer tests generate temporary workbooks through `MiniExcel::save_as*()` and read them back through `MiniExcel::query*()`, covering dynamic and typed values, dates, multiple worksheets, row counts, empty schemas, default/custom/disabled freeze panes, explicit path overwrite behavior, and worksheet-name validation. Template tests cover scalar and mixed text, native numbers and booleans, XML escaping, formula-injection protection, missing-variable policy, empty and populated arrays, multiple sheets, style retention, path overwrite, and byte workflows. The WASM adapter has native unit tests, while Browser Lab Playwright tests cover generated-workbook rendering, query controls, inclusive end ranges, and desktop/mobile viewports.
120+
Writer tests generate temporary workbooks through `MiniExcel::save_as*()` and read them back through `MiniExcel::query*()`, covering dynamic and typed values, dates, multiple worksheets, row counts, empty schemas, default/custom/disabled freeze panes, header/headerless/typed AutoFilter ranges, explicit path overwrite behavior, and worksheet-name validation. Template tests cover scalar and mixed text, native numbers and booleans, XML escaping, formula-injection protection, missing-variable policy, empty and populated arrays, multiple sheets, style retention, path overwrite, and byte workflows. The WASM adapter has native unit tests, while Browser Lab Playwright tests cover generated-workbook rendering, query controls, inclusive end ranges, and desktop/mobile viewports.
120121

121122
## .NET Parity Contract
122123

docs/compatibility.zh-CN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Rust MVP 在统一的 `MiniExcel` facade 后实现最小但实用的 MiniExcel
4848
| 多工作表导出 | `save_as_sheets()` / `save_as_serialized_sheets()` | 保留输入工作表顺序并返回数据行数 |
4949
| `overwriteFile` | `WriteOptions::with_overwrite_file()` | 默认 `false`;已有路径需要显式允许覆盖 |
5050
| `FreezeRowCount` / `FreezeColumnCount` | `WriteOptions::with_freeze_row_count()` / `with_freeze_column_count()` | 默认冻结一行、零列 |
51+
| `AutoFilter` | `WriteOptions::with_auto_filter()` | 默认 `true`;覆盖完整写入范围 |
5152
| 基础模板填充 | `save_as_template()` / `save_as_template_bytes()` | 标量占位符与单 row 数组展开;保留 package part |
5253

5354
`MiniExcel` 是唯一公共行为入口。Reader、writer、parser 和具体迭代器类型均为 crate 内部实现。公共支持类型仅限 row/cell value、结构化 provenance row、option、error/result 和 Serde date/time helper。
@@ -116,7 +117,7 @@ Rust integration test 复用仓库 `tests/data/xlsx` 下的现有文件,包括
116117
- 强制 shared-string 磁盘 spill、索引 lookup、无效目录处理、纯内存 byte query 和提前 drop 清理。
117118
- structured formula text、缓存值、A1 地址、style ID、内置/自定义 number format、range 和提前丢弃迭代器。
118119

119-
Writer test 通过 `MiniExcel::save_as*()` 生成临时 workbook,并使用 `MiniExcel::query*()` 回读,覆盖动态和类型化 value、date、多工作表、行数、空 schema、默认/自定义/禁用冻结窗格、显式 path 覆盖行为和 worksheet name 验证。模板测试覆盖标量与混合文本、原生 number/boolean、XML 转义、公式注入防护、缺失变量策略、空数组与非空数组、多工作表、样式保留、path 覆盖和 byte 工作流。WASM adapter 有原生 unit test,Browser Lab Playwright test 则覆盖生成 workbook 的渲染、query 控件、包含端点的结束 range,以及桌面/移动 viewport。
120+
Writer test 通过 `MiniExcel::save_as*()` 生成临时 workbook,并使用 `MiniExcel::query*()` 回读,覆盖动态和类型化 value、date、多工作表、行数、空 schema、默认/自定义/禁用冻结窗格、header/headerless/typed AutoFilter 范围、显式 path 覆盖行为和 worksheet name 验证。模板测试覆盖标量与混合文本、原生 number/boolean、XML 转义、公式注入防护、缺失变量策略、空数组与非空数组、多工作表、样式保留、path 覆盖和 byte 工作流。WASM adapter 有原生 unit test,Browser Lab Playwright test 则覆盖生成 workbook 的渲染、query 控件、包含端点的结束 range,以及桌面/移动 viewport。
120121

121122
## .NET 等价契约
122123

docs/dotnet-feature-gaps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Rust already implements dynamic and Serde-typed XLSX path queries, inclusive A1
4141
| Fluent mapping | Missing | Address-based object mapping, formula/format mappings, collection start cells and spacing, nested collections, and mapped import/export/template APIs. |
4242
| Attribute-based mapping | Partial | Column index/name attributes, localized headers, width/hidden/formula metadata, custom dynamic formatters, field mapping, and dynamic column ordering/filtering. Serde covers rename, alias, defaults, skips, options, and custom serializers, but not these Excel-specific contracts. |
4343
| Read configuration | Partial | Culture-aware conversion, buffer/fast modes, and some null/empty-string behavior. Merged-cell filling and shared-string disk caching are implemented. |
44-
| Write configuration and style | Partial | Tables/autofilters, right-to-left sheets, auto width, header style/alignment/wrapping, shared versus inline strings, and broader cell styling. Rust exposes sheet name, header output, frozen rows/columns, and number formats. |
44+
| Write configuration and style | Partial | Tables, right-to-left sheets, auto width, header style/alignment/wrapping, shared versus inline strings, and broader cell styling. Rust exposes sheet name, header output, AutoFilter, frozen rows/columns, and number formats. |
4545
| Sheet metadata/workflow | Partial | Table metadata, comment metadata, dynamic sheet aliases, class-level sheet selection, and traversing all sheets through one reader. Rust already covers names, order, dimensions, visibility, and active state. |
4646
| Provider/package model | Different by design | .NET composes OpenXML, CSV, templating, and fluent-mapping providers. Rust has a single XLSX crate plus CLI and WASM adapters; those adapters do not replace the missing provider capabilities. |
4747

docs/dotnet-feature-gaps.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Rust 已支持动态及 Serde 强类型 XLSX 路径查询、闭区间 A1 范围
4141
| Fluent Mapping | 未实现 | 基于地址的对象映射、公式/格式映射、集合起始单元格与间距、嵌套集合,以及映射式导入/导出/模板 API。 |
4242
| 特性式字段映射 | 部分实现 | 列索引/名称特性、本地化表头、宽度/隐藏/公式元数据、自定义动态格式器、字段映射,以及动态列排序/过滤。Serde 可覆盖重命名、别名、默认值、跳过、可选值和自定义序列化,但不覆盖这些 Excel 专属约定。 |
4343
| 读取配置 | 部分实现 | 区域文化感知转换、缓冲/快速模式,以及部分 null/空字符串行为。合并单元格填充和 shared-string 磁盘 cache 已实现。 |
44-
| 写入配置与样式 | 部分实现 | 表格/自动筛选、从右到左工作表、自动列宽、表头样式/对齐/换行、共享字符串与内联字符串选择,以及更广泛的单元格样式。Rust 已暴露工作表名、是否输出表头、冻结行列和数字格式。 |
44+
| 写入配置与样式 | 部分实现 | 表格、从右到左工作表、自动列宽、表头样式/对齐/换行、共享字符串与内联字符串选择,以及更广泛的单元格样式。Rust 已暴露工作表名、是否输出表头、AutoFilter、冻结行列和数字格式。 |
4545
| 工作表元数据与流程 | 部分实现 | 表格元数据、批注元数据、动态工作表别名、类级工作表选择,以及通过一个 reader 遍历所有工作表。Rust 已覆盖名称、顺序、尺寸、可见性和活动状态。 |
4646
| Provider/包模型 | 设计不同 | .NET 组合 OpenXML、CSV、模板和 Fluent Mapping provider。Rust 使用单一 XLSX crate 加 CLI/WASM 适配器;这些适配器不能替代上述缺失能力。 |
4747

0 commit comments

Comments
 (0)