poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Beardsley <markbrd...@tiscali.co.uk>
Subject Re: Problem in reading data from merged cells in excel using XSSF
Date Wed, 29 Feb 2012 17:07:13 GMT
Not sure what you are asking here. Are you saying that you want the worksheet
to ensure that users are entering six digits into the cells in a specific
column or are you saying that you want to write code using POI that will
allow you to check that the users did enter six digit codes into a specific
column.

If the former then you need to look at data validations (and there is a
section in the Quick Guide covering this), if the latter then you simply
need to write code that will;

Open the workbook.
Get the sheet.
Iterate through the rows on the sheet and for each row get the cell that
would be in the specific column.
Get the contents of the cell and, if they are numeric, convert them into a
String value using Java's native language support - hint String.valueOf().
Check the length of the String - all Strings have the length() function
defined and available for this.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/Problem-in-reading-data-from-merged-cells-in-excel-using-XSSF-tp5512364p5525498.html
Sent from the POI - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message