英文:
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<Object>, "Filename");
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论