Free Support Forum - aspose.com

Saving of Presentation fails with Charts with Unsupported Formulas

In our application we are using aspose.slides to fill powerpoint documents, defined by the user, with data from our backend, when using charts with certain formulars in the datasheet apsose throws an exception on saving the document. (which did not happen in earlier versions)

I am using Aspose.Slides 21.4
When saving a Presentation, where a slide contains chart which is using IF or OR functions in its data areas

Sample Formular =IF(OR(in!$H5="False";in!$H5="");in!B5;"Z")

Exception: Aspose.Slides.Spreadsheet.CellUnsupportedDataException: The cell 'temp'!F4 contains an unsupported formula.

This error did not exist in previous version of Aspose(19.8), there I had to use Aspose.Cell to recalculate the workbook and reapplied it to the chart. When the calculation was not successfully the chart went in the document without a view update, this happened without an error from the aspose side, this was also not ideal, but still better than how it is now.

There are a few issues I have with this error:

  1. Why does this error happen at saving and not earlier. This error should happen at the moment when I modify the chart, not on saving the document.
    At the moment our generator is at the mercy that the user did not use any unsupported formular. Currently Report that was generated totally fine, can crash because of one lousy chart. And I am not even able to choose to catch this errors so I could add an error message to the chart and have an otherwise fine working document

  2. Why does it happen at all? We are talking about IF and OR functions which are two of the most basic spreadsheet functions.

  3. Can I disable the processing of the charts onSave so it would use the cached values in the spreadsheet provided by Aspose.Cells? And atleast the generation would not crash

Currently our only workaround for this error is to not use the charts or the unsupported formular. Which defeats the point of using it.

Greetings Julian

@jnvoigt,
Thank you for the issue description. At the moment, Aspose.Slides doesn’t support OR function for calculations. Please, look at the next article: Predefined Functions.

Usually, if you don’t call a recalculation of formulas containing unsupported expressions, the document is saved without errors.

Could you share the presentation file and code example reproducing the issue, please?

I’ve logged the issue in our tracking system with ID SLIDESNET-42552 to add supporting the OR function.

Unfortunately, when the formula in the cell changes, the last calculated cached value is reset. I’ve logged the issue in our tracking system with ID SLIDESNET-42553 to consider adding such an ability.

Thank you for the quick response

I build a sample in the next days

@jnvoigt,
Thank you, it will help us better understand the issue.

ChartCrashSample.zip (84.9 KB)
Ok in the zip is a boiled down version that can reproduce the errors

in the AsposeLicense.cs you need to change the path
there are two samples,

  1. nested IFs
    this will cause the presentation save call to crash

  2. OR in IF the presentation will save with updated data, but the chart wont update until open the data sheets

behavior of 2 is more ok than 1.

When using the commented out Refresh-Call in Program.cs it’s working fine because the workbook update is made by cells.
This is were I have good news, I may be able to fix our bug on my own.

@jnvoigt,
Thank you for the project example. I reproduced the issues and received the same results. I’ve logged the issues in our tracking system with ID SLIDESNET-42559 and SLIDESNET-42560. Our development team will investigate these cases. I will inform you about any progress.