Hello again... As clarification, I would like to mention that after doing some tests on a real excel file, for the correct operation of shiftRows() method, if we delete merged rows, we must first eliminate the merged region including the rows for delete to function properly.
In case of keeping the merged rows, the shiftRows() method doesn't move the rows correctly, even if the merged region includes only the cells in a single row. Regards, Hello, The correct method to keep the size is sheet.shiftRows(int startRow,int endRow,int n, boolean copyRowHeight, boolean resetOriginalRowHeight), where copyRowHeight must be true. If a merged regions is between the shift rows may be problems. That is odd because the javadoc for thosemethods indcates that they do shift merged regions; "Additionally shifts merged regions that are completely defined in these rows (ie. merged 2 cells on a row to be shifted). " Is this not the case? Yours Mark B -- View this message in context: http://apache-poi.1045710.n5.nabble.com/Remove-rows-from-excel-tp3414141p3414261.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@poi.apache.org For additional commands, e-mail: user-h...@poi.apache.org ********************************************************************************************** No imprimas este correo si no es absolutamente necesario. Piensa en el medio ambiente. Este mensaje y los ficheros anexos que, en su caso, incorpore pueden contener información confidencial o de uso exclusivamente interno de CAJA DE AHORROS DE VALENCIA, CASTELLON y ALICANTE, BANCAJA, sujeto a secreto profesional. Si Ud. lo recibe por error o considera que no es el destinatario del mismo, deberá destruirlo y comunicar al emisor esta circunstancia, no pudiendo en ningún caso distribuir, divulgar ni copiar el mensaje. **********************************************************************************************