We purchased a .NET Pro Edition license for Spire.XLS and are currently running v7.8.26.7040.
We have encountered an issue when converting an Excel worksheet to PDF where some cells containing formulas are exported to PDF showing "#VALUE!".
For Example:
The cell A45 (formatted as 'accounting', 2 decimal places, '$') is a simple formula of a subtraction of 2 other cells, however the 2 other cells have more complex formulas:
A45=B65-C65
where:
B65=SUMIF($F$11:$F$41,$A$64:$A$73,$J$11:$J$41)
C65=SUMIF($F$11:$F$41,$A$64:$A$73,$S$11:$S$41)
where: column F is a lookup value and column J the values.
In Excel A45 shows a value of '$46.87' however, in the exported PDF file A45 shows a value of '#VALUE!'
I am using streams to convert the worksheet to PDF:
- Code: Select all
var outputPdfDocument = new PdfDocument();
foreach (Worksheet worksheet in workbook.Worksheets.Where(x => worksheetIndexes.Contains(x.Index + 1)))
{
using (var worksheetStream = new MemoryStream())
{
worksheet.SaveToPdfStream(worksheetStream);
var pdfDocument = new PdfDocument();
pdfDocument.LoadFromStream(worksheetStream);
outputPdfDocument.AppendPage(pdfDocument);
}
}
What can I do to get the Excel formula resultant values in the exported PDF file?
Thank you,
Charles