poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MSB <markbrd...@tiscali.co.uk>
Subject Re: [PROBLEM] POI and Excel : First Quote in Cell
Date Sat, 27 Feb 2010 08:20:08 GMT

Thought about this a little more whilst watching the rugby match last night
and I wonder if that leading apostrophe causes Excel to default a specific
style onto the cell.

If you have the chance to do this before me - I have a site visit this
morning and an orgy of rugby again this afternoon - check out the
HSSFDataFormatter class and specifically the methods that return a formatted
String describing the cell's contents. These methods apply the cell format
to the value returned and that may be one way to get at this leading
apostrophe. Other than that, when time allows, I am going to have a dig into
the actual value stored in the file to see where that apostrophe actually
is. One other thought that did occur is that perhaps the code that recovers
the vaue from the cell simply strips off this character although I do doubt
that this would happen as it seems too arbitrary.

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.HSSFCellStyle@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.HSSFCellStyle@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.HSSFCellStyle@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.HSSFCellStyle@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.HSSFCellStyle@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
> timothee.chevrier@logica.com
> 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: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/-PROBLEM--POI-and-Excel-%3A-First-Quote-in-Cell-tp27715413p27726388.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Mime
View raw message