• Post Reply Bookmark Topic Watch Topic
  • New Topic

POI, Excel - howto do i get a list of Merged Region in Sheet  RSS feed

 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

i receive a file that i have to process and i am trying to use Apache POI for that.

the sheet i have to collect data from has multiple merge regions (merged cells)

in POI, i can find a method that removes this merged cells.

but how do i find the merged cells?

in POI i can have this method:


but i would presume that i would be able to have a list of the Merged Regions in the sheet.

but i can not find how to collect it.

would someone please explain this?

thanks,

 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i honestly do not understand the logic of POI




this method is supposedly providing me the number of Merged Regions on the sheet:

workbook.getSheetAt(sheetIndex).getNumMergedRegions();

i have a value of 44 returned by this method, but my loop throws error at iteration 22.

and if i changed my code for:



by checking on every iteration i find that not all merged regions are removed..

anybody has any suggestions?


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!