Unfortunetly a cell style does not include details on if a cell is part of a merge region or not, in fact each cell that is part of a merge region can have its own HSSFCellStyle.

I myself need to copy and paste cells that are part of a merge so I've created my own custom cell style class that records the dimensions of the merge and all the styles of the cells in the merge. Then I created my own cell writer method that accepts the custom cell style class and writes X number of cells to the sheet and sets up a new merge region on the sheet for them.

Its a little bit of work but solves the problem.

Tim

Dmitry Beransky wrote:

Hi,

within excel, if I copy&paste the format of a merged cell, the destination cell also becomes merged. However, if I try do to the same from POI (i'm using v2.5), the merged setting doesn't carry over. Here's what I'm currently doing:

style = myOrignalCell.getCellStyle();
destCell.setCellStyle(style);

is there anything special I need to do for merged cells?


Thanks Dmitry


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to