You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "wujinhuangye-io (via GitHub)" <gi...@apache.org> on 2026/01/28 09:24:25 UTC

[I] [Enhancement] 在模板填充数据的时候有时候数据不是以一行为一组数据填充,是多行的。 [fesod]

wujinhuangye-io opened a new issue, #836:
URL: https://github.com/apache/fesod/issues/836

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fesod/issues) and found nothing similar.
   
   
   ### Motivation
   
   能否支持多行是一对象的填充。
   
   <img width="1695" height="358" alt="Image" src="https://github.com/user-attachments/assets/51c3e14c-be80-4471-a627-5fc0fce30c3c" />比如这里的数据我是2行填充。但是编码的字段会每行填充导致数据对不上
   
   ### Solution
   
   _No response_
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [Enhancement] 在模板填充数据的时候有时候数据不是以一行为一组数据填充,是多行的。 [fesod]

Posted by "bengbengbalabalabeng (via GitHub)" <gi...@apache.org>.
bengbengbalabalabeng commented on issue #836:
URL: https://github.com/apache/fesod/issues/836#issuecomment-3811860203

   May I take this issue? :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [Enhancement] 在模板填充数据的时候有时候数据不是以一行为一组数据填充,是多行的。 [fesod]

Posted by "bengbengbalabalabeng (via GitHub)" <gi...@apache.org>.
bengbengbalabalabeng commented on issue #836:
URL: https://github.com/apache/fesod/issues/836#issuecomment-3817875591

   > This issue would be best served by providing a simple and executable sample code.
   
   @delei  Thanks for the feedback. I’ll make sure to provide a proposal first next time.
   
   ### Proposal
   
   This proposal introduces support for Multi-row Loop Filling restricted to the VERTICAL direction. It addresses the limitation where multi-row templates or merged regions were incorrectly overwritten during iteration.
   
   - Multi-row loop filling.
   - Cell merge handling.
   
   ### API Usage Example
   
   #### 1. Basic multi-row loop filling
   
   Filling a multi-row template without special merge strategies.
   
   - Prepare to fill the template:
   
   <img width="1003" height="172" alt="Image" src="https://github.com/user-attachments/assets/eefcb11c-fbf5-4f41-b74e-0eb859e5f338" />
   
   <details>
   
   <summary>Click to review full code</summary>
   
   - Define excel model:
   
   ```java
   @Data
   public class ExcelModel {
       
       private Integer no;
   
       private String code;
   
       private String label;
   
       private String name1;
   
       private String name2;
   
       private String totalCount;
   
       private String totalWeight;
   
       private String count1;
   }
   ```
   
   - Demo:
   
   ```java
   FesodSheet.write("/pathname/output.xlsx")
       .withTemplate("/pathname/template.xlsx")
       .head(ExcelModel.class)
       .sheet()
       .doFill(datas(), FillConfig.builder().build());
   ```
   
   </details>
   
   - Output:
   
   <img width="742" height="282" alt="Image" src="https://github.com/user-attachments/assets/f1a9c74e-dc36-49e7-8385-9ba476e2bc2f" />
   
   #### 2. Multi-row filling with auto merge
   
   Automatically handling merged regions based on template cell.
   
   - Prepare to fill the template:
   
   <img width="1003" height="172" alt="Image" src="https://github.com/user-attachments/assets/83069971-fd8c-41ca-bebd-ff3f93e5ab04" />
   
   <details>
   
   <summary>Click to review full code</summary>
   
   - Define excel model:
   
   ```java
   @Data
   public class ExcelModel {
       
       private Integer no;
   
       private String code;
   
       private String label;
   
       private String name1;
   
       private String name2;
   
       private String totalCount;
   
       private String totalWeight;
   
       private String count1;
   }
   ```
   
   - Demo:
   
   ```java
   FesodSheet.write("/pathname/output.xlsx")
       .withTemplate("/pathname/template.xlsx")
       .head(ExcelModel.class)
       .sheet()
       // Use FillMergeStrategy.AUTO to handle merge regions
       .doFill(datas(), FillConfig.builder().mergeStrategy(FillMergeStrategy.AUTO).build());
   ```
   
   </details>
   
   - Output:
   
   <img width="1011" height="316" alt="Image" src="https://github.com/user-attachments/assets/62e25a53-a297-4e58-8233-cdfee5f1e55a" />
   
   #### 3. Multi-row loop filling with auto merge and copy merged regions cell-styles
   
   Copying cell styles for merged regions (High Overhead).
   
   > NOTE
   > 1. **This solution is currently under verification.**
   > 2. **Excessive cell-styles may cause performance issues.**
   
   - Prepare to fill the template:
   
   <img width="771" height="151" alt="Image" src="https://github.com/user-attachments/assets/bd487b88-3b4d-4361-bb9b-567d9fe8fd0c" />
   
   <details>
   
   <summary>Click to review full code</summary>
   
   - Define excel model:
   
   ```java
   @Data
   public class ExcelModel {
       
       private Integer no;
   
       private String code;
   
       private String label;
   
       private String name1;
   
       private String name2;
   
       private String totalCount;
   
       private String totalWeight;
   
       private String count1;
   }
   ```
   
   - Demo:
   
   ```java
   FesodSheet.write("/pathname/output.xlsx")
       .withTemplate("/pathname/template.xlsx")
       .head(ExcelModel.class)
       .sheet()
       // Use FillMergeStrategy.MERGE_CELL_STYLE to handle merge regions and applies styles to the entire merged region
       .doFill(datas(), FillConfig.builder().mergeStrategy(FillMergeStrategy.MERGE_CELL_STYLE).build());
   ```
   
   </details>
   
   - Output:
   
   <img width="741" height="256" alt="Image" src="https://github.com/user-attachments/assets/204a44eb-8965-44cb-8c33-fdf3cbef32f8" />


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [Enhancement] 在模板填充数据的时候有时候数据不是以一行为一组数据填充,是多行的。 [fesod]

Posted by "wujinhuangye-io (via GitHub)" <gi...@apache.org>.
wujinhuangye-io commented on issue #836:
URL: https://github.com/apache/fesod/issues/836#issuecomment-3816564237

   > May I take this issue? :)
   
   https://github.com/apache/fesod/pull/387 这个是否合并了?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [Enhancement] 在模板填充数据的时候有时候数据不是以一行为一组数据填充,是多行的。 [fesod]

Posted by "delei (via GitHub)" <gi...@apache.org>.
delei commented on issue #836:
URL: https://github.com/apache/fesod/issues/836#issuecomment-3812319204

   > May I take this issue? :)
   
   Welcome, This issue would be best served by providing a simple and executable sample code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org


Re: [I] [Enhancement] 在模板填充数据的时候有时候数据不是以一行为一组数据填充,是多行的。 [fesod]

Posted by "bengbengbalabalabeng (via GitHub)" <gi...@apache.org>.
bengbengbalabalabeng commented on issue #836:
URL: https://github.com/apache/fesod/issues/836#issuecomment-3817970017

   > [#387](https://github.com/apache/fesod/pull/387) 这个是否合并了?
   
   You may refer to my [proposal ↑](https://github.com/apache/fesod/issues/836#issuecomment-3817875591). I will proceed with the implementation and plan to finish it as soon as possible.  :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org