Dear All,
Basically, I have been trying to make my C# program use Excel’s NORMDIST(x, mean, st.dev, cumulative) function on an Excel template than I have already generated, to generate a point on a graph, and I seem to be having a problem with Aspose when it exports the Excel to PDF.
For example;
//Values have been input into the Workbook
sheet1.Cells[“A1”].Formula = “=NormDist(B1, A2, A3, False)”;
Workbook.CalculateFormula();
//Export Excel to PDF
When the excel is the exported to PDF, the values become Cumulative (changing the False to True in the formula), and I have no idea why this happens?
I put a break point before it exports to see if it was Workbook.CalculateFormula() that calculated the value incorrectly but when I look at the values in the PDF document they are cumulative.
Please help, many thanks.
PS. Here is a link to my other post, incase it gets a reply and this one doesn’t.
Hi there,
I followed your advice and upgraded my Aspose to the version you linked me to, and the problem is still persisting.
My colleagues and I can not work out whether it is the conversion causing the issue or the Aspose.Cells.CalculateFormulas method, either way, the Excel method re-calculates the values incorrectly.
I have attached a template Excel sheet and the converted PDF sheet. (Apologies for the poor formatting) My program passes a number to “F23” on Sheet1 of the Excel Template file, when the value is changed the equation in “G23” changes value and so changes the position of the point on the graph.
This works well when simply changing values in Excel and it will update automatically.
However when this is done within the program, if the CalculateFormulas method is not called, when a value is put into F23, G23 does not update and so it will be in the wrong position on the graph.
Though when CalculateFormulas is called, it produces an output like the PDF file, changing all the Methods from =NormDist(x, mean, sd, FALSE) to =NormDist(x, mean, sd, TRUE).
Many Thanks,
Fernify
Hi,
Thanks for sharing the template files.
After an initial test, I can notice the issue as you have mentioned. The calculated value in the G23 cell is rendered as we have put “TRUE” (which we did not) for the formula i.e…, “=NORMDIST($F$23,$D$1,$F$1,FALSE)” in the first worksheet of your template file. Also, due to this, the graph is also not rendered fine.
Sample code:
Workbook wb = new Workbook(@“e:\test2\Template.xls”);
wb.Worksheets[0].Cells[“F23”].PutValue(120);
wb.CalculateFormula();
wb.Save(“e:\test2\Template1.pdf”);
I have logged a ticket with an id: CELLSNET-41133 for your issue. We will look into your issue and figure it out soon.
Thank you.
Hi,
We have fixed this issue.
Please download and try this fix: Aspose.Cells for .NET v7.3.2.4
Thank you.
The issues you have found earlier (filed as CELLSNET-41133) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.