I have the following code a project where a databar is placed on a cell. This worked well until version 22.3.
int index = m_Worksheet.getConditionalFormattings().add();
FormatConditionCollection fcc = m_Worksheet.getConditionalFormattings().get(index);
CellArea ca = new CellArea();
ca.StartRow = 4;
ca.EndRow = 4;
ca.StartColumn = 2;
ca.EndColumn = 2;
fcc.addArea(ca);
int idx = fcc.addCondition(FormatConditionType.DATA_BAR);
FormatCondition cond = fcc.get(idx);
DataBar dataBar = cond.getDataBar();
dataBar.getMaxCfvo().setType(FormatConditionValueType.NUMBER);
dataBar.getMaxCfvo().setValue(20);
dataBar.setMaxLength(100);
dataBar.setColor(Color.fromArgb(180, 0, 0));
A few days ago I had to replace the license and wanted to evaluate the latest version 25.9.
The xslx generation worked well on Mac devices but did NOT on Windows devices.
Windows always shows the follows stacktrace when the closeWorkbook() method is executed:
Caused by: com.aspose.cells.CellsException: Invalid FormatConditionType val
at com.aspose.cells.p7t.B(Unknown Source)
at com.aspose.cells.h2n.a(Unknown Source)
at com.aspose.cells.h2n.a(Unknown Source)
at com.aspose.cells.h2n.x(Unknown Source)
at com.aspose.cells.h2n.a(Unknown Source)
at com.aspose.cells.e70.a(Unknown Source)
at com.aspose.cells.g_0.a(Unknown Source)
at com.aspose.cells.g_0.d(Unknown Source)
at com.aspose.cells.g_0.a(Unknown Source)
at com.aspose.cells.m19.a_(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at de.mytestproject.AsposeCellsReport.closeWorkbook(AsposeCellsReport.java:195)
I’ve also tried to add getMinCfvo().setType() and getMinCfvo.setValue() but this did not change anything.
The java version I’m using is Zulu 17.
Is this a known issue or is there any workaround?
Best,
Oliver