[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 --- Comment #6 from Sven --- Created attachment 36207 --> https://bz.apache.org/bugzilla/attachment.cgi?id=36207=edit Contains a formatted date cell to reproduce the behavior -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 Sven changed: What|Removed |Added Resolution|LATER |--- Status|RESOLVED|REOPENED --- Comment #5 from Sven --- Hello, I've noticed the same behavior with POI 4.0.0-final. In my attached xlsx-file there is only a single cell with the formula „=date(2018;1;1)“. This cell must be formatted with a format that contains at least one dot (e.g. „T. MMM. “). Whether this xlsx-file is created with Excel 365 or LibreOffice 6.1.2.1 does not change anything. It's the same behavior in both situations. In org.apache.poi.xssf.model.StylesTable.readFrom(InputStream) there is a call „styleSheet.getNumFmts()“. This returns a ctfmts with ctfmts._textsource._user.toString() as follows: http://schemas.openxmlformats.org/markup-compatibility/2006; xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac; xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main; xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision; xmlns:main="http://schemas.openxmlformats.org/spreadsheetml/2006/main;> It seems to me as if the format strings contain „/\“ where dots should be. Code used to read the xlsx-file: import java.io.File; import java.util.Locale; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.FormulaEvaluator; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; public class ReadXlsxTest { public static void main(String[] args) throws Exception { // read workbook File xlsxFile = new File("date.xlsx"); Workbook workbook = WorkbookFactory.create(xlsxFile); FormulaEvaluator formulaEvaluator = workbook.getCreationHelper().createFormulaEvaluator(); formulaEvaluator.clearAllCachedResultValues(); Sheet sheet = workbook.getSheetAt(0); // print input cell for (Row row : sheet) { for (Cell cell : row) { System.out.println(cell.getAddress()); String formattedValue = new DataFormatter(Locale.ENGLISH).formatCellValue(cell, formulaEvaluator); System.out.println(formattedValue); } } } } Result in Excel and in LibreOffice: „1. Jan. 2018“. Result in POI 4.0.0-final: „1/ Jan/ 2018“. This behavior is the same with other locales, e.g. German. So I'm reopening this issue as Dominik suggested. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 Dominik Stadlerchanged: What|Removed |Added Resolution|--- |LATER Status|NEEDINFO|RESOLVED --- Comment #4 from Dominik Stadler --- We cannot reproduce the problem with only screenshots, no sample file was provided, so we cannot do much here unless we get more information. Thus closing this as LATER for now, please reopen with more information if this is still a problem for you. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 Andreas Beekerchanged: What|Removed |Added Component|POI Overall |SS Common Hardware|PC |All -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 Dominik Stadlerchanged: What|Removed |Added Status|NEW |NEEDINFO --- Comment #3 from Dominik Stadler --- Please provide a sample file which allows to reproduce the problem. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 Kushalchanged: What|Removed |Added Status|NEEDINFO|NEW -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 --- Comment #2 from Kushal--- Created attachment 35716 --> https://bz.apache.org/bugzilla/attachment.cgi?id=35716=edit Cell format string As requested attaching the image of cell format -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org
[Bug 62084] Issue with date format
https://bz.apache.org/bugzilla/show_bug.cgi?id=62084 Nick Burchchanged: What|Removed |Added Status|NEW |NEEDINFO OS||All --- Comment #1 from Nick Burch --- What is the format string applied to that cell? -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org