feature: support multi-rows loop filling and merge strategies - #842
Open
bengbengbalabalabeng wants to merge 22 commits into
Open
feature: support multi-rows loop filling and merge strategies#842bengbengbalabalabeng wants to merge 22 commits into
bengbengbalabalabeng wants to merge 22 commits into
Conversation
- Fix incorrect shiftRows behavior in the combined filling mode - Fix SXSSF row flushing issue where flushed rows become inaccessible - Add corresponding unit tests
Contributor
Author
|
@delei PTAL :) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for multi-row loop filling and introduces configurable merged-region replication during vertical list filling, with accompanying docs and regression tests.
Changes:
- Refactors
ExcelWriteFillExecutorto account for multi-row “rowSpan” when shifting rows and advancing write positions during loop fills. - Introduces
FillMergeStrategy+FillConfig.mergeStrategyto control automatic merge replication (and optional merged-cell style unification). - Adds docs (EN + zh-CN) and a comprehensive integration test suite with new/updated fill templates.
Reviewed changes
Copilot reviewed 7 out of 31 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| website/i18n/zh-cn/docusaurus-plugin-content-docs/current/sheet/fill/fill.md | Adds zh-CN documentation for merge strategies and multi-row loop filling examples. |
| website/docs/sheet/fill/fill.md | Adds EN documentation for merge strategies and multi-row loop filling examples. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/write/metadata/fill/FillConfig.java | Adds mergeStrategy to fill configuration with defaults + validation. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/write/executor/ExcelWriteFillExecutor.java | Implements multi-row row-span advancing + merge replication and merged-style unification. |
| fesod-sheet/src/main/java/org/apache/fesod/sheet/enums/FillMergeStrategy.java | New enum defining merge handling strategies for loop fills. |
| fesod-sheet/src/test/java/org/apache/fesod/sheet/fill/LoopRowFillingMergeTest.java | New end-to-end tests covering multi-row fill + merge strategies for xls/xlsx and combined fill. |
| fesod-sheet/src/test/java/org/apache/fesod/sheet/fill/LoopRowFillingMergeModel.java | Test model for multi-row fill cases. |
| fesod-sheet/src/test/resources/fill/case_a_07.xlsx | Template for base multi-row loop fill (.xlsx). |
| fesod-sheet/src/test/resources/fill/case_b_07.xlsx | Template for AUTO merge strategy (.xlsx). |
| fesod-sheet/src/test/resources/fill/case_c_07.xlsx | Template for MERGE_CELL_STYLE strategy (.xlsx). |
| fesod-sheet/src/test/resources/fill/case_d_07.xlsx | Template for combined list+common base fill (.xlsx). |
| fesod-sheet/src/test/resources/fill/case_e_07.xlsx | Template for combined list+common fill with AUTO merge (.xlsx). |
| fesod-sheet/src/test/resources/fill/case_f_07.xlsx | Template for combined list+common fill with MERGE_CELL_STYLE (.xlsx). |
| fesod-sheet/src/test/resources/fill/case_a_03.xls | Template for base multi-row loop fill (.xls). |
| fesod-sheet/src/test/resources/fill/case_b_03.xls | Template for AUTO merge strategy (.xls). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
@delei PTAL :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the pull request
Related: #836
What's changed?
1. Support multi-rows loop filling.
Refactor row shifting logic in
ExcelWriteFillExecutor. UpdatedshiftRowsanddoFillto correctly handle row offsets when a loop item spans multiple rows.2. Add
FillMergeStrategyto handling merge across rows and columns.Implemented through theaddMergedRegionIfNecessarymethod, which replicates the merge structure defined in the template row and applies it to each generated data row.Implemented through the
addMergedRegionIfNecessarymethod, which replicates only the merged regions that intersect cells containing template variables. Merged regions in the template row that do not cover any placeholder cells are intentionally not replicated.See the API Usage Example for usage examples.
Checklist