I have two workbooks and each contains one sheet in it. Now I want to combine these two worksheets to one workbook as two sheets using POI and java .
Can anyone tell me how to do this ?
I have two workbooks and each contains one sheet in it. Now I want to combine these two worksheets to one workbook as two sheets using POI and java .
Can anyone tell me how to do this ?
you can do it using a library named "aspose"
Workbook sheet1= new Workbook("file1.xlsx");
Workbook sheet2= new Workbook("file2.xlsx");
sheet1.combine(sheet2);
sheet1.save("mergedFile.xlsx");
And add this dependency into your pom
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cells</artifactId>
</dependency>