Many thanks, Karsten, that was just what was needed.

Regards,
 
Trevor

-----Original Message-----
From: Karsten Voges [mailto:[EMAIL PROTECTED] 
Sent: 11 April 2006 08:47
To: 'POI Users List'
Subject: AW: How can I recognise merged cells in Excel spreadsheet

You do not get the information about merged cells in a cell itself, but only
in the sheet.
See below for some example code.
HTH,
Karsten.

Region mRegion = null;
        
for (int i = 0; i < sheet.getNumMergedRegions(); i++) {
                
        mRegion = sheet.getMergedRegionAt(i);
        int fromRow = mRegion.getRowFrom();
        int toRow = mRegion.getRowTo();
        int fromCol = mRegion.getColumnFrom();
        int toCol = mRegion.getColumnTo();
        //Do something here with the infos
}

-----Ursprüngliche Nachricht-----
Von: Trevor Stuart at Pyramis [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 10. April 2006 18:07
An: 'POI Users List'
Betreff: How can I recognise merged cells in Excel spreadsheet

Hello everyone,

Can anyone tell me how to recognise 2 or more cells are merged cells?

So, for instance, I have an input Excel spreadsheet which contains cells
A1-A3 set as merged with
the contents "Associates" and I need to be able to recognise that the first
3 cells are to be
notionally processed as a single unit with the correct contents.

HSSFCell and HSSFCellStyle do not appear to give me the required
information.

Any hints would be gratefully received.

Many thanks,
 
Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to