I'm using this snippet to format an date cell to a real date:
The date is formatted in German. Actually it should show it in "display format" ("what the user sees") which is f.e. "01.02.2021". Unfortunately it shows 02/01/21 (short form and english/american).
I think the java formatter needs a locale setting/parameter. Any ideas how to set it and how?
B4X:
ub PoiGetFormattedCellValue(ExcelCell As PoiCell) As String
Dim JOCell As JavaObject = ExcelCell
Dim JODataFormatter As JavaObject
Dim JOConditionalFormattingEvaluator As JavaObject
Dim JOFormulaEvaluator As JavaObject =JOCell.RunMethodJO("getSheet",Null).RunMethodJO("getWorkbook",Null).RunMethodJO("getCreationHelper",Null).RunMethodJO("createFormulaEvaluator",Null)
JOConditionalFormattingEvaluator.InitializeNewInstance("org.apache.poi.ss.formula.ConditionalFormattingEvaluator",Array As Object (JOCell.RunMethodJO("getSheet",Null).RunMethodJO("getWorkbook",Null),JOCell.RunMethodJO("getSheet",Null).RunMethodJO("getWorkbook",Null).RunMethodJO("getCreationHelper",Null).RunMethodJO("createFormulaEvaluator",Null)))
Return JODataFormatter.InitializeNewInstance("org.apache.poi.ss.usermodel.DataFormatter",Null).RunMethod("formatCellValue",Array As Object (JOCell,JOFormulaEvaluator,JOConditionalFormattingEvaluator))
End Sub
The date is formatted in German. Actually it should show it in "display format" ("what the user sees") which is f.e. "01.02.2021". Unfortunately it shows 02/01/21 (short form and english/american).
I think the java formatter needs a locale setting/parameter. Any ideas how to set it and how?