Hi Yuly,
Hope you are doing well.
1. About the exception when using CalculateAllValue, after an initial test with Spire.XLS Version 7.12.19.6040, I am still unable to reproduce it. To help us solve your issue quickly, please share your sample file.
2. As for downloading the file, I tested with the latest version, there is no issue. Besides, there is a workaround. Please refer to following code.
- Code: Select all
string fileName = Server.MapPath("~\\test.xlsx");
Workbook workbook = new Workbook();
workbook.CalculateAllValue();
workbook.LoadFromFile(fileName);
MemoryStream stream = new MemoryStream();
workbook.SaveToStream(stream, FileFormat.PDF);
string outputFileName = string.Format("{0}{1}", "TestResult", ".pdf");
Response.Clear();
Response.AppendHeader("Content-Disposition", "attachment; filename=" + outputFileName);
Response.AppendHeader("Content-Length", stream.ToArray().Length.ToString());
Response.ContentType = "application/pdf";
Response.BinaryWrite(stream.ToArray());
HttpContext.Current.ApplicationInstance.CompleteRequest();
Response.Flush();
Response.End();
Sincerely,
Mike
E-iceblue support team