开发者

POI dynamic templates

开发者 https://www.devze.com 2022-12-23 19:08 出处:网络
Can anyone tell me where do I find some useful documentation on handling copying rows, cells, columns from one excel file to another, using POI?

Can anyone tell me where do I find some useful documentation on handling copying rows, cells, columns from one excel file to another, using POI? I need to开发者_运维技巧 insert in one blank excel file, 2 or more templates from other files, dynamic.

I also need to keep all the styles made for the group of cells that I copy. How can I do that? Nothing found on apache poi tutorial on this point.

I am using POI 3.0.1.

Thank you!


I assume the problem is data types and merged cells? It's easy enough to get and set styles and set values.

Depending on your use case, you might be able to take entire sheets from the original document, assemble the new document from those and tweak it to your liking. Even if you have to combine multiple source sheets into one target sheet, you might still be able to retrieve source rows and assemble the target document from those rows.


...that was me some time ago...

I never could copy from one excel file to another with the exact style, but I found a solution : I used multiple worksheets instead of multiple excel files, cause style has no problem in being copied from one sheet to another as long as it is in the same workbook.

I also migrated from POI3.0.1 to POI 3.6. Far much better.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号