When we convert an Excel tab to PDF, valid numbers in some cells are converted to “#DIV/0!” in the PDF.
I have attached an example Excel spreadsheet. Note that on the tab “Funding Schedule” there are no cells with “#DIV/0!”. In the attached PDF, second page, the converted tab has some “#DIV/0!” values (highlighted in yellow).
This is a .NET environment. Excel 2007, Aspose.Cells.dll= 7.6.0.0, Aspose.PDF.dll = 8.5.0.0.
Thanks for any assistance!
Hi David,
Thank you for using Aspose products.
I have evaluated your presented scenario while using the latest version of Aspose.Cells for .NET 7.7.1.0, and I am able to replicate the said issue. Formula fields are displayed as #DIV/0! when your provided spreadsheet is converted to PDF. An investigative ticket (CELLSNET-42295) has been logged in our bug tracking system to probe further into this matter. Please spare us little time to properly analyze the problem cause, and to provide a fix (if applicable). In the meanwhile, we will keep you posted with updates in this regard.
Please accept our apologies for your inconvenience.
Do you have any ideas why some formulas work and others don’t? Or any suggestions for workarounds?
Thanks.
Hi David,
Sorry for a bit delayed response.
I have worked further with your presented scenario in order to find out a workaround for the time being. Usually, Workbook.CalculateFormula method does the trick to resolve any calculation related scenarios before setting the Workbook to render. In this case it isn’t helping. I have also checked other properties publicly exposed by Aspose.Cells for .NET API, but I am afraid, I am unable to find a solution at this moment.
As discussed earlier, we may take sometime to properly analyze the problem on our end. As soon as we have isolated the problem cause, we will quickly move forward to fix it for you with the next release of Aspose.Cells for .NET API.
Please accept our apologies for the inconvenience caused.
We tried several variations to see if we could work around this, did not succeed.
We did notice that when we replaced N5 in the Funding Schedule tab (which had the formula “=R22”) with a constant value, the “#DIV/0!” cells converted correctly. It is not a workaround, but it might help your analysts.
Thanks.
Hi David,
Thanks for using Aspose.Cells.
We are pleased to let you know that this issue has been fixed. We will hopefully provide you a fix in next week. Once, it is available for you, we will let you know asap.
Hi,
Thanks for using Aspose.Cells.
We have fixed this issue.
Please download and try this fix: Aspose.Cells
for .NET v7.7.1.1 and let us know your feedback.
Sorry, we are getting a new error in 7.7.1.1 with the above .xlsm file. Here’s code and a stack trace:
String filePathIn = “w:/Tasks/Div by zero 1617/Div by zero example.xlsm”;
String filePathOut = “w:/Tasks/Div by zero 1617/Div by zero example.pdf”;
Workbook xls = new Workbook(filePathIn);
xls.Save(filePathOut);
Threw an exception in VS 2012:
Aspose.Cells.CellsException was unhandled
HResult=-2146232832
Message=Object reference not set to an instance of an object.
Source=Aspose.Cells
StackTrace:
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)
at Aspose.Cells.Workbook.Save(String fileName)
at AsposeTesting.Program.ConvertExcelDocToPdf() in c:\Users\dwolff\Documents\Visual Studio 2012\Projects\AsposeTesting\AsposeTesting\Program.cs:line 46
at AsposeTesting.Program.Main(String[] args) in c:\Users\dwolff\Documents\Visual Studio 2012\Projects\AsposeTesting\AsposeTesting\Program.cs:line 21
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Hi David,
Thanks for your feedback and using Aspose.Cells.
We were able to observe this exception with the latest version. If you use workbook.CalculateFormula() before saving to pdf, exception is not thrown. We have reopened this issue 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.
Hi,
Thanks for using Aspose.Cells.
We have fixed this issue.
Please download and try the latest version: Aspose.Cells for .NET v7.7.1.2 and let us know your feedback.
The issues you have found earlier (filed as CELLSNET-42295) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
The issues you have found earlier (filed as CELLSNET-42295) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(1)
All fixed! It’s now in production. Thank you!
Hi David,
Thanks for your feedback and using Aspose.Cells.
It is good to know that your issues are fixed with the latest version. Let us know if you face any other issue, we will be glad to look into them and help you further.