An error message pop up after save

Hi team,

We have an excel with some pivot table in it. After calling save method, it generate a pop up message say: ‘an item name cannot be found…’ when open the output excel. Attach the error message.
We used aspose cells 8.4.2

The excel is a bit large about 45M and I tried to upload it here multiple times but cannot add it successful. Please let me know how I can pass the excel to you to check it.

Thanks.

Hi Sissi,


First of all, please give a try to the latest version of the API. I believe you are using Java API so please download & try Aspose.Cells for Java 8.4.2.8 on your end. In case the problem persists, please upload the sample to any of the free file hosting services or your own server, and share the download link here. Please also provide the code snippet if you are manipulating the spreadsheet in any way before saving it back.

Thanks for your reply.


The latest Java API cannot work. I upload the original excel to below link. The excel version is 2010.

http://pan.baidu.com/s/1bnHGGqV


The code i used is as below.
String file_path = "c:\\test\\original.xlsx";
String outputPath = "c:\\test\\output.xlsx";
Workbook workbook = new Workbook(file_path);
workbook.save(outputPath);

Please let me know if you need more information.

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

Please try below dropbox link to download the file.

Dropbox - original.xlsx - Simplify your life

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!


Can I get to know when will this be fixed?

Hi Sissi,


Please note, the ticket logged earlier as CELLSNET-43721 is currently pending for analysis, and is in the queue with other priority tasks. We cannot share an estimated schedule for the fix unless we have properly analyze the scenario to pin point the problem cause. Please spare us little more time for investigation. As soon as we have updates for you, we will post here for your reference.

This is a blocking issue on our end, a bit urgent, can you please priority this. Thanks so much!


BTW, we used Aspose Cells for Java, not .Net.

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,


Please try our latest version/fix: Aspose.Cells for .NET v8.5.0.1

We have fixed your issue “CELLSNET-43721” now.

Let us know your feedback.

Thank you.

Hi team,

I want to clarify again here, we are using Aspose Cells for Java, not for .Net.
Could you please provide a fixed version for Java to me?

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,

Just want to have an update here, is this still be tracked and can we get the fixed version by end of this week on time?

Thanks!

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,


Please try our latest version/fix: Aspose.Cells for Java v8.5.0.2

We have fixed your issue “CELLSJAVA-41376” now.

Let us know your feedback.

Thank you.

Hi team,

The new library resolved initial issue but introduced another issue. Add formatting conditions is not working… Attached the difference result generated from 8.4.2.0 and 8.5.0.2

used same code, take cell E18 and S18 as an example:
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: hmpFomulaAndColor.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);
}


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”);