注意本例需要jxls的支持
/**
* copy all rows include styles from source sheet to target sheet
* @param srcSheet
* @param targetSheet
*/
public static void copySheet(HSSFSheet srcSheet, HSSFSheet targetSheet){
Iterator it = srcSheet.rowIterator();
while(it.hasNext()){
HSSFRow srcRow = (HSSFRow) it.next();
Util.copyRow(srcSheet, targetSheet, srcRow, targetSheet.createRow(srcRow.getRowNum()));
}
}
本文介绍了一种使用jxls支持的方法,将源工作表的所有行及其样式复制到目标工作表中。通过迭代源表的每一行,并调用Util.copyRow方法完成样式复制。

1万+

被折叠的 条评论
为什么被折叠?



