Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I get data formateed value from a numberic cell #251

Open
danmaidesenling opened this issue May 4, 2022 · 2 comments
Open

Can I get data formateed value from a numberic cell #251

danmaidesenling opened this issue May 4, 2022 · 2 comments

Comments

@danmaidesenling
Copy link

Hi,
Can I get data formateed value from a numberic cell ?
File file = new File("C:\\Users\\Marvinh\\Desktop\\wrong_2021120932 - Análises Fopag 12.2021.xlsx"); //XSSFWorkbook xssfWorkbook = new XSSFWorkbook(file); DataFormatter formatter = new DataFormatter(); Workbook workbook = StreamingReader.builder() .rowCacheSize(100) .bufferSize(1024) .open(file); for(Sheet sheet : workbook){ for(Row row : sheet){ if(row.getRowNum() == 27){ for(Cell cell2 : row){ if(cell2.getColumnIndex() == 8){ System.out.println(formatter.formatCellValue(cell2)); } } } } }
this will occur issue with

com.monitorjbl.xlsx.exceptions.NotSupportedException
at com.monitorjbl.xlsx.impl.StreamingCell.getSheet(StreamingCell.java:330)
at org.apache.poi.ss.usermodel.DataFormatter.isDate1904(DataFormatter.java:313)
at org.apache.poi.ss.usermodel.DataFormatter.getFormat(DataFormatter.java:309)
at org.apache.poi.ss.usermodel.DataFormatter.getFormattedNumberString(DataFormatter.java:858)
at org.apache.poi.ss.usermodel.DataFormatter.formatCellValue(DataFormatter.java:1011)
at org.apache.poi.ss.usermodel.DataFormatter.formatCellValue(DataFormatter.java:961)
at org.apache.poi.ss.usermodel.DataFormatter.formatCellValue(DataFormatter.java:940)

on System.out.println(formatter.formatCellValue(cell2));

Is there anyway to fix this in version 2.1.0 ?
Or Does this be handled in the latest verison ?

@pjfanning
Copy link
Contributor

you also created #252 - your issue is basically a duplicate of #193

@danmaidesenling
Copy link
Author

you also created #252 - your issue is basically a duplicate of #193

Thank you ! Have closed #252 I will update xlsx-streamer version to 2.2.0 and try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants