poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten Voges" <karsten.vo...@jato-consulting.de>
Subject AW: How can I recognise merged cells in Excel spreadsheet
Date Tue, 11 Apr 2006 07:46:35 GMT
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:tstuart@pyramis.co.uk] 
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: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


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


Mime
View raw message