Please do not think that this is a stupid question but, can you see that leading apostrophe in the cell when you view the sheet using Excel?
The reason I ask this is twofold. Firtly, I always understood that one way to force Excel to accept the contents of a cell as being text was to precede them with an apostrophe; thus Excel would see '1234.45 as text and not as a number. Secondly, I have just tried in 'my' own version of Excel (Excel 2007) and if I enter this value 'VLA and then click on the green tick to enter the value into the cell a couple of things happen. The value is entered into the cell but, and it is a big but, the leading apostrophe is not shown. The only way to see that leading apostrophe is to select the cell and then I can see the value 'VLA but only in the editing bar. It would seem to me that POI may well be reporting the value correctly as Excel - at least in the small test I have just run - shows just this value in the cell. Where the leading apostrophe is stored, I do not know I am sorry to say. Yours Mark B Chevrier, Timothée wrote: > > Hello, > > Currently I encounter a strange problem and I don't know how to solve it > using POI. I'm not sure I can. > > In my cell i've the value ['BLA]. The cell type is text. In POI, i can't > catch the first apostrophe. It's not part of the value. > Can we avoid this behaviour using POI ? > Does any body as a solution to catch this first quote (apostrophe) in a > text cell ? > > Just for your information. > Here is what I get in a sample Read/system.out program : > Debut du traitement d'imports de fichiers Excel > LIGNE 1 : Cellule sans quote > cell.getCellType() : 1 > cell.getStringCellValue() : BLA > cell.toString() : BLA > cell.getCellComment() : null > cell.getCellStyle() : org.apache.poi.hssf.usermodel.hssfcellst...@1b9142d0 > cell.getRichStringCellValue() : BLA > cell.getHyperlink() : null > LIGNE 2 : Cellule avec quote STANDARD > cell.getCellType() : 1 > cell.getStringCellValue() : BLA > cell.toString() : BLA > cell.getCellComment() : null > cell.getCellStyle() : org.apache.poi.hssf.usermodel.hssfcellst...@5a9aa9f7 > cell.getRichStringCellValue() : BLA > cell.getHyperlink() : null > LIGNE 3 : Cellule avec quote TEXTE > cell.getCellType() : 1 > cell.getStringCellValue() : BLA > cell.toString() : BLA > cell.getCellComment() : null > cell.getCellStyle() : org.apache.poi.hssf.usermodel.hssfcellst...@8f166529 > cell.getRichStringCellValue() : BLA > cell.getHyperlink() : null > LIGNE 4 : Cellule avec quote PERSO > cell.getCellType() : 1 > cell.getStringCellValue() : BLA > cell.toString() : BLA > cell.getCellComment() : null > cell.getCellStyle() : org.apache.poi.hssf.usermodel.hssfcellst...@8f166529 > cell.getRichStringCellValue() : BLA > cell.getHyperlink() : null > LIGNE 5 : Cellule avec quote STANDARD et numérique > cell.getCellType() : 1 > cell.getStringCellValue() : 99 > cell.toString() : 99 > cell.getCellComment() : null > cell.getCellStyle() : org.apache.poi.hssf.usermodel.hssfcellst...@5a9aa9f7 > cell.getRichStringCellValue() : 99 > cell.getHyperlink() : null > > > I've tried several POI classes to read my Excel workbook (version 3.6): > - HSSFCell > - ExcelExtractor > - Row and HSSFListener > > Just FYI, I've also tried JExcel 2.6. > > Thanks for your help, > > Regards, > Timothée CHEVRIER > > --------------------------------------------------------------------------- > > LOGICA > > > > T. : +33 (0)2 14 37 80 78 > VOIP : 14078 > [email protected] > www.logica.com/france > > > Please help Logica to respect the environment by not printing this email > / Pour contribuer comme Logica au respect de l'environnement, merci de ne > pas imprimer ce mail / Bitte drucken Sie diese Nachricht nicht aus und > helfen Sie so Logica dabei, die Umwelt zu schützen. / Por favor ajude a > Logica a respeitar o ambiente nao imprimindo este correio electronico. > > > > This e-mail and any attachment is for authorised use by the intended > recipient(s) only. It may contain proprietary material, confidential > information and/or be subject to legal privilege. It should not be copied, > disclosed to, retained or used by, any other party. If you are not an > intended recipient then please promptly delete this e-mail and any > attachment and all copies and inform the sender. Thank you. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://old.nabble.com/-PROBLEM--POI-and-Excel-%3A-First-Quote-in-Cell-tp27715413p27721071.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
