;
>>>
>>> default:
>>> retVal = "";
>>> }
>>> return retVal;
>>> }
>>>
>>> private String i
ormatter df = new DataFormatter();
>> //This is where i am trying to add the custom format to the
>> list to already available formats.
>> //DecimalFormat def=new DecimalFormat("#-#");
>> //df.addFormat("&qu
ingDecimal.java:1207)
> at java.lang.Double.parseDouble(Double.java:220)
> at
> org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:197)
> at
> org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(DateUtil.java:278)
> at
> com.excel.reader.ExcelDataR
gDecimal.java:1207)
> at java.lang.Double.parseDouble(Double.java:220)
> at
> org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:197)
> at
> org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(DateUtil.java:278)
> at
> com.excel.reader.ExcelDataReader.isNumberOrDate(ExcelDataReader.java:166)
> at com.excel.reader.ExcelDataReader.getCellValue(ExcelDataReader.java:154)
> at com.excel.reader.ExcelDataReader.process(ExcelDataReader.java:118)
> at com.excel.reader.ExcelDataReader.main(ExcelDataReader.java:249)
> Exception in thread "main" ACBS 2001 7528080 Java Result: 1
>
>
>
--
View this message in context:
http://old.nabble.com/Read-Custom-format-cell-value-tp28894102p28940911.html
Sent from the POI - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: user-unsubscr...@poi.apache.org
For additional commands, e-mail: user-h...@poi.apache.org
t; do have to admit I have not looked through the sheets contents
>>>>>> throughly yet.
>>>>>>
>>>>>> Yours
>>>>>>
>>>>>> Mark B
>>>>>>
>>>>>>
>>>>>> S
cell format as 49.
>>>>>>
>>>>>> So i guess the api consides once the cell type is formula it uses
>>>>>> parse double to get the value where it fails as the data contains
>>>>>> other characters too.
>>>>>>
utility breaks
>>>>>> while trying to extract the double value for the cell which shouldn't
>>>>>> happen. This seems like a bug to me.
>>>>>>
>>>>>> Try opening the .xlsx file with an archive utility like WinZip. Unzip
>>
If the cell is indeed numeric
>>>>> then the value of 't' must be 'n' and you can also see the value of
>>>>> 's'. It must be a number that points to the style index in the
>>>>> workbook styles section. The styles are kept in a sepa
d in another reply, you should get hold of the
>>>> cell style. From the cell style you'll get the format index. From the
>>>> format index you can get the format string. And that format string
>>>> cannot be directly used as a java format. The format conventions are
>>>&g
p code etc.
>>>
>>> But i just don't know how to do that.
>>>
>>> Just incase will that help me...if so could you please provide some help
>>> on
>>> that.
>>>
>>>
>>> Jankiraman, Radhakrishnan wrote:
>>
a and excel. Have you tried reading the cell value "as
>> a string" ? Unless you need the typed cell value, you might be better off
>> just extracting the formatted string as is.
>>
>> -Rk
>>
>> __
>> Radhakrishnan Jankiraman
>> (
g the formatted string as is.
>
> -Rk
>
> __
> Radhakrishnan Jankiraman
> (o) +91.20-30239400 extn 520 (c) +91.9822006056
>
>
> -Original Message-
> From: Siva_Masilamani [mailto:saachins...@yahoo.co.in]
> Sent: Wednesday, June 16,
iraman
(o) +91.20-30239400 extn 520 (c) +91.9822006056
-Original Message-
From: Siva_Masilamani [mailto:saachins...@yahoo.co.in]
Sent: Wednesday, June 16, 2010 8:29 AM
To: user@poi.apache.org
Subject: RE: Read Custom format cell value
Thanks again.
But i was reading the api and came to know that we
oatingDecimal.readJavaFormatString(FloatingDecimal.java:1207)
> at java.lang.Double.parseDouble(Double.java:220)
> at
> org.apache.poi.xssf.usermodel.XSSFCell.getNumericCellValue(XSSFCell.java:197)
> at
> org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(DateUtil.java:278)
oo.co.in]
> Sent: Wednesday, June 16, 2010 4:57 AM
> To: user@poi.apache.org
> Subject: RE: Read Custom format cell value
>
>
> Hi
>
> Thanks for your reply.
>
> The file is of type xlsx.
> We are receiving this file from our client and we are in no control of
> alte
version of POI are you using ?
If you don't have control over the format, then no luck.
-Rk
-Original Message-
From: Siva_Masilamani [mailto:saachins...@yahoo.co.in]
Sent: Wednesday, June 16, 2010 4:57 AM
To: user@poi.apache.org
Subject: RE: Read Custom format cell value
Hi
June 16, 2010 2:32 AM
> To: 'POI Users List'
> Subject: RE: Read Custom format cell value
>
> This is how you try to get a format
>
> CreationHelper creationHelper = workbook.getCreationHelper();
>
> //If this format is one of the default formats, will
-Original Message-
From: Siva_Masilamani [mailto:saachins...@yahoo.co.in]
Sent: Tuesday, June 15, 2010 10:52 PM
To: user@poi.apache.org
Subject: Read Custom format cell value
Hi
I am using apache poi api to read data from the excel file and having
problem with particular data format.
On
-
From: Siva_Masilamani [mailto:saachins...@yahoo.co.in]
Sent: Tuesday, June 15, 2010 10:52 PM
To: user@poi.apache.org
Subject: Read Custom format cell value
Hi
I am using apache poi api to read data from the excel file and having
problem with particular data format.
One of the coumns in the
a:166)
at com.excel.reader.ExcelDataReader.getCellValue(ExcelDataReader.java:154)
at com.excel.reader.ExcelDataReader.process(ExcelDataReader.java:118)
at com.excel.reader.ExcelDataReader.main(ExcelDataReader.java:249)
Exception in th
20 matches
Mail list logo