基于预定义的Excel模板创建一个Excel工作表。

huangapple go评论67阅读模式
英文:

Create an excel worksheet based on a predefined excel template

问题

我有一个称为“模板”的 .xls 文件。现在我的问题是我想创建 50 多个具有与该模板相同格式的 .xls 文件。因此,我正确的问题是:如何使用 Java 根据 Excel 模板创建工作表(Excel 文件)?是否有任何方法可以在工作表之间进行样式复制的情况下完成这个操作?

英文:

I have an .xls file which I call it model. Now my probleme is that I want to create over 50 .xls file that have that same format of the model. So properly my question is : how do I create a worksheet (excel file) based on an excel template using java? Is there is any way to do it without copying the style between sheets ??

答案1

得分: 1

这个例子没有使用预定义的模板,但你可以查看我的代码,并将其转换成对你有用的东西。
https://github.com/ernst223/spread-sheet-exporter

所以你可以在我的类中编写样式,然后将我的类用于你所有的Excel文件

SpreadSheetExporter spreadSheetExporter = new SpreadSheetExporter(List<Object>, "文件名");
File fileExcel = spreadSheetExporter.getExcel();
英文:

This example does not use a pre defined template but you can go check out my code and morph it into something worth for you.
https://github.com/ernst223/spread-sheet-exporter

So you can maybe code the style in my class and then use my class for all of your excel files

SpreadSheetExporter spreadSheetExporter = new SpreadSheetExporter(List&lt;Object&gt;, &quot;Filename&quot;);
File fileExcel = spreadSheetExporter.getExcel();

答案2

得分: -1

你之前没有显然的努力,就提问了,我也会做同样的事情。Excel API

英文:

as you didn't make any apparent effort before asking i will do the same
excel api

huangapple
  • 本文由 发表于 2020年9月25日 21:37:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/64065268.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定