You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 693dfbf
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -456,6 +456,26 @@ Negative indices clamp to the first position and oversized indices clamp to the
456
456
formula text, visibility, and worksheet IDs remain unchanged. Moving to the current effective
457
457
index is a byte-for-byte no-op.
458
458
459
+
Like .NET `CopyAndAddSheet`, Rust can copy a complete source workbook to a separate destination
460
+
and generate or replace one worksheet in the copied package:
461
+
462
+
```rust
463
+
letcount=MiniExcel::copy_and_add_sheet(
464
+
"source.xlsx",
465
+
"destination.xlsx",
466
+
&rows,
467
+
&InsertOptions::new().with_sheet_name("Added"),
468
+
)?;
469
+
```
470
+
471
+
Dynamic, explicit-schema one-pass, and Serde variants are available. The source is never modified;
472
+
source aliases are rejected, and the destination is atomically published only after package
473
+
validation. Existing destinations are rejected unless `with_overwrite_file(true)` is set.
474
+
`ExistingSheetPolicy` and `TargetRelationshipPolicy` retain their Insert meanings. Unlike .NET's
475
+
shallow package regeneration, Rust raw-copies unrelated parts and preserves workbook identities,
476
+
relationships, defined names, formulas, tables, drawings, comments, pivots, and external links.
477
+
This API copies the whole workbook and adds data; it does not clone an arbitrary selected worksheet.
478
+
459
479
Enable the optional `async` feature to feed an existing-workbook Insert from a runtime-neutral
460
480
`Stream<Item = miniexcel::Result<DynamicRow>>`:
461
481
@@ -554,10 +574,10 @@ Version 1 does not implement `@group`, `@if`, parametrized sheet cloning, `$=` f
554
574
- Grouped analytics retain state proportional to distinct groups and stop at `max_groups`.
555
575
- RAG exports never recalculate formulas and reject hidden sheets unless explicitly allowed.
556
576
- Synchronous streaming queries use one worker thread per active query. Optional async query and Insert APIs use bounded channels around blocking XLSX workers; ZIP/XML/filesystem work is not async I/O.
557
-
- Save creates new workbooks and refuses existing target paths by default. `MiniExcel::insert*()` atomically appends or strictly replaces a worksheet in an existing `.xlsx` path, or creates a workbook when the path is missing. `rename_sheet()`, `set_sheet_visibility()`, and `reorder_sheet()` atomically change existing workbook sheet metadata.
577
+
- Save creates new workbooks and refuses existing target paths by default. `MiniExcel::insert*()` atomically appends or strictly replaces a worksheet in an existing `.xlsx` path, or creates a workbook when the path is missing. `copy_and_add_sheet*()` creates a validated source-derived destination. `rename_sheet()`, `set_sheet_visibility()`, and `reorder_sheet()` atomically change existing workbook sheet metadata.
558
578
559
579
## Not Supported
560
580
561
-
`.xls`, `.xlsb`, `.ods`, advanced template directives, macros, images, merged-cell operations, formula authoring, a general style system, and arbitrary worksheet copying are not currently supported.
581
+
`.xls`, `.xlsb`, `.ods`, advanced template directives, macros, image authoring, merged-cell operations, formula authoring, a general style system, and arbitrary selected-worksheet cloning are not currently supported.
562
582
563
583
See the [compatibility matrix](docs/compatibility.md) for the current support scope and the [MiniExcel v1 Insert migration guide](docs/insert-v1-migration.md) for deliberate differences.
The comparison uses the .NET public APIs, their controlling implementations, and focused tests under the sibling `../MiniExcel` checkout. Rust status is based on the public `MiniExcel` facade, options, integration tests, and [compatibility boundary](compatibility.md).
| Async and cancellation | Partial | Optional runtime-neutral dynamic/Serde path queries and explicit-schema Insert support bounded streams and cooperative cancellation. Async export/template operations, async write sources, borrowed async readers, and progress callbacks remain unsupported. ZIP and filesystem work remains blocking on dedicated workers. |
35
35
| General save inputs | Partial | Export from general objects/enumerables, dictionaries, `DataTable`, `IDataReader`, and async enumerables, with progress. Rust accepts dynamic or same-type Serde slices and reports per-sheet row counts. |
36
36
| Multi-sheet export | Partial | Rust creates ordered visible, hidden, and very-hidden worksheets, but does not yet accept heterogeneous Serde row types in one call. |
37
-
| Existing-workbook operations |Partial| Rust atomically appends, strictly replaces, renames, changes visibility, or reorders worksheets while preserving unrelated package parts and worksheet identity. Copy-and-add remains unsupported. Rename preserves formula text; visibility rejects hiding the final visible sheet; reorder remaps active/view/local-name indices instead of transferring their ownership. |
37
+
| Existing-workbook operations |Implemented| Rust atomically appends, strictly replaces, renames, changes visibility, reorders, and performs .NET-style source-workbook copy-and-add while preserving unrelated package parts and worksheet identity. Rename preserves formula text; visibility rejects hiding the final visible sheet; reorder remaps active/view/local-name indices; copy-and-add preserves the source and atomically publishes a separate destination. |
38
38
| Templates | Partial | Rust fills path/byte templates with scalar values and single-row arrays while preserving package parts. Streams, grouping, conditions, parametrized sheets, `$=` formulas, formula-reference updates, and calculation-chain handling remain unsupported. |
39
39
| Pictures and merge processing | Missing | Add anchored pictures and merge adjacent identical cells through the templater surface. Structured reads do not provide authoring parity. |
40
40
| CSV | Implemented | Dynamic/Serde path, byte, and borrowed query/save APIs; column discovery; inferred/explicit-schema append; delimiter/newline/encoding/BOM/null/quoting configuration; and `query-csv` CLI. DataReader/DataTable are replaced by Rust iterators. Async/progress APIs and a one-call CSV/XLSX converter are not exposed. |
| DataReader/DataTable | Rust iterators and borrowed visitors are the native abstraction; no literal .NET tabular adapter is planned |`OpenXmlImporter.GetDataReader`, `GetAsyncDataReader`, `QueryAsDataTableAsync`; `tests/MiniExcel.OpenXml.Tests/DataReader/`|
58
-
| Multi-sheet and workbook edits | Writer creates multiple sheets; existing workbooks support append, strict replacement, and all independent `AlterSheet` metadata operations with atomic package preservation |`OpenXmlExporter.InsertSheetAsync`, `CopyAndAddSheetAsync`, `AlterSheetAsync`; `tests/MiniExcel.OpenXml.Tests/MultipleSheets/` and `AlterSheets/`|
58
+
| Multi-sheet and workbook edits | Writer creates multiple sheets; existing workbooks support append, strict replacement, every independent `AlterSheet` metadata operation, and source-to-destination `CopyAndAddSheet`with atomic package preservation |`OpenXmlExporter.InsertSheetAsync`, `CopyAndAddSheetAsync`, `AlterSheetAsync`; exporter, `MultipleSheets/`, and `AlterSheets/` tests|
59
59
| Templates/pictures/merges | Basic template fill implemented; advanced directives and authoring remain deferred |`src/MiniExcel.OpenXml/Api/OpenXmlTemplater.cs`; `tests/MiniExcel.OpenXml.Tests/Templates/`|
60
60
| CSV/conversion |`MiniExcel::query_csv*`, `save_csv*`, and `append_csv*`; Rust tests use exact `TestHeader.csv` (`6C2FC27FCA2876F1ECCA17061B8EE23E133ECDB726F8E0B84167E58D86234432`) and GB2312 (`BA8A2505AB271D5575C58CC1FCBE5A5002CEB9E2F43CB95412246E25A50E8B5A`) fixtures |`src/MiniExcel.Csv/Api/`; `src/MiniExcel/MiniExcelConverter.cs`; `tests/MiniExcel.Csv.Tests/`|
@@ -68,7 +68,7 @@ The .NET APIs marked with `Async` also have generated synchronous counterparts t
68
68
69
69
1.**Async export/template APIs**: extend runtime-neutral producer/cancellation patterns without presenting blocking ZIP work as async I/O.
70
70
2.**Advanced templates and Fluent Mapping**: add grouped/conditional templates, parametrized sheets, and mapping through separate compatibility milestones.
71
-
3.**Remaining workbook edits**: copy-and-add requires a relationship-closure cloning contract.
71
+
3.**Selected-sheet cloning**: not part of .NET `CopyAndAddSheet`; add only for a concrete Rust use case with a relationship-closure cloning contract.
72
72
73
73
DataReader/DataTable are .NET ecosystem abstractions and are intentionally not literal Rust parity requirements. A Rust-native record-batch or tabular adapter is appropriate only when a concrete integration requires it.
74
74
@@ -78,6 +78,7 @@ DataReader/DataTable are .NET ecosystem abstractions and are intentionally not l
78
78
- The .NET numeric `QueryRange` overload is not counted separately because Rust A1 `CellReference` bounds express the same selection.
79
79
- Internal implementation classes and .NET-specific dependency-injection mechanics are excluded unless they expose observable behavior.
80
80
- CSV DataReader/DataTable and a dedicated CSV/XLSX converter are excluded because Rust iterators and composed query/save calls provide the native equivalents.
81
+
- Arbitrary selected-sheet cloning is not counted because .NET `CopyAndAddSheet` copies the whole source workbook and generates a sheet from row data; Rust now implements that observable operation.
81
82
- Legacy binary Excel formats are excluded because this comparison found no current .NET V2 public provider that would make them a parity requirement.
82
83
83
84
Re-run this comparison whenever either pinned revision changes. New parity claims should be added to the shared contract only after both public adapters and focused tests cover the behavior.
0 commit comments