简体   繁体   English

使用jxl API保留Excel格式

[英]Preserve excel format using jxl API

I am using JXL to copy from one excel sheet to another. 我正在使用JXL从一个Excel工作表复制到另一个。 When the data is getting copied to a new cell, it loses the actual formatting. 当数据被复制到新的单元格时,它将丢失实际的格式。

Eg. 例如。 The large cells are converted to smaller ones in the new excel file. 在新的excel文件中,大单元格将转换为较小的单元格。

Can someone please let me know if this is possible. 有人可以让我知道是否可能。

Regards 问候

Bipul Bipul

You should copy not only cell, but it's format too. 您不仅应复制单元格,还应复制其格式。

   oldCellFormat = oldCell.getCellFormat();
   newCellFormat = new WritableCellFormat(oldCellFormat );
   newCell.setCellFormat(newCellFormat);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM