Hi team,
Hi Sissi,
Thanks for your reply.
http://pan.baidu.com/s/1bnHGGqV
Hi,
Thanks for your posting and using Aspose.Cells.
Please attach your excel file somewhere else like dropbox or Aspose.Cells forum. I was unable to access your file from this link.
http://pan.baidu.com/s/1bnHGGqV
Hi,
Thanks for your posting and using Aspose.Cells.
We were able to observe this error which pops up when workbook is saved using Aspose.Cells. We tested this issue with the latest version: Aspose.Cells
for .NET v8.4.2.7.
We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-43721 - Error message pops up after saving workbook
I have also attached the screenshot showing the error for a reference.
Thanks team!
Hi Sissi,
This is a blocking issue on our end, a bit urgent, can you please priority this. Thanks so much!
Hi,
Thanks for your clarification and using Aspose.Cells.
We were also able to replicate the same issue in java version and logged a ticket. Please spare us some time a week or two to fix this issue.
This issue has been logged as
- CELLSJAVA-41376 - Error message pops up after saving workbook
Hi,
Hi team,
Hi,
Thanks for your posting and using Aspose.Cells.
Please spare us some more time 2-3 days before we could provide you a java fix. Mostly, if the issue is fixed in .net, it is also get fixed in java version in next few days. Hopefully, java fix will also be available soon for your need.
Hi Team,
Hi,
Thanks for your posting and using Aspose.Cells.
We have checked the issue status of your java ticket from database and found it is already fixed. So we are hopeful that you will get the fix in next few days most probably on Friday.
Hi,
Hi team,
Hi,
Thanks for using Aspose.Cells.
Please provide us a console application project replicating this issue with the older and latest version. We will run your project at our end and investigate this issue and update you asap.
Thanks for your cooperation.
The pasted code is not enough? just copy to java main method and prepare an excel with same data in previous attached. and using your library to run, you will see it's condition format in excel is set incorrect.
Hi,
Thanks for your posting and using Aspose.Cells.
I have tested this issue with the following code which is same as yours except that I have made it runnable. It generates the output excel file which I have attached for your reference. The output excel file looks good. I have also attached the screenshot showing the added conditional formatting(s).
I have tested this issue with the latest version: Aspose.Cells
for Java v8.5.0.4.
Java
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.getWorksheets().get(0);
HashMap<String, Color> hmpFormulaAndColor = new HashMap<String, Color>();
String actualSalesCell = “E18”;
String expectSalesCell = “S18”;
String formulaWithYellow = “=AND(”+actualSalesCell+“>0,”+actualSalesCell+“<”+expectSalesCell+“,”+expectSalesCell+“<>"-")”;
hmpFormulaAndColor.put(formulaWithYellow, Color.getYellow());
String formulaWithRed = “=AND(”+actualSalesCell+“=0,”+actualSalesCell+“<”+expectSalesCell+“,”+expectSalesCell+“<>"-")”;
hmpFormulaAndColor.put(formulaWithRed, Color.getRed());
formulaWithRed = “=AND(”+actualSalesCell+“="-",”+expectSalesCell+“>0,”+expectSalesCell+“<>"-")”;
hmpFormulaAndColor.put(formulaWithRed, Color.getRed());
formulaWithRed = “=AND(”+actualSalesCell+“<0,”+expectSalesCell+“>0,”+expectSalesCell+“<>"-")”;
hmpFormulaAndColor.put(formulaWithRed, Color.getRed());
//set condition
Cell cell = worksheet.getCells().get(“E18”);
CellArea ca = new CellArea();
ca.StartRow = cell.getRow();
ca.StartColumn = cell.getColumn();
ca.EndRow = cell.getRow();
ca.EndColumn = cell.getColumn();
ConditionalFormattingCollection cfsc = worksheet.getConditionalFormattings();
int index = cfsc.add();
FormatConditionCollection fcs = cfsc.get(index);
//set the conditional format range
fcs.addArea(ca);
for(Map.Entry<String, Color> entry: hmpFormulaAndColor.entrySet()) {
String formula = entry.getKey();
Color color = entry.getValue();
int conditionIndex = fcs.addCondition(FormatConditionType.EXPRESSION, OperatorType.NONE, “”, “”);
FormatCondition fc = fcs.get(conditionIndex);
fc.setFormula1(formula);
fc.getStyle().setBackgroundColor(color);
fc.setStopIfTrue(false);
}
workbook.save(“output.xlsx”);