Save to a Response File

Trying to save workbook to a response file as documented in the product documentation but Response is not an option. Have Version 8.7.1 Was this done away with and documentation is wrong or has this been replaced with a new method?

Hi,

Thanks for your posting and using Aspose.Cells.

Do you want to save your file in response stream like in ASP.NET C# or VB.NET web application.

If you need something else, then please elaborate your requirements with more detail. We will look into it and help you asap.

Please use this code to save your file in XLS or in XLSX format in Response stream.

C#


//Save file and send to client browser using selected format
if (yourFileFormat == “XLS”)
{
workbook.Save(HttpContext.Current.Response, “output.xls”, ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Excel97To2003));

}
else
{
workbook.Save(HttpContext.Current.Response, “output.xlsx”, ContentDisposition.Attachment, new OoxmlSaveOptions(SaveFormat.Xlsx));
}

HttpContext.Current.Response.End();


The code you are showing is exactly what I am trying to do but Response is not an option with this version. It was available in prev versions.

Hi,

Thanks for your feedback and using Aspose.Cells.

Probably, you are using Client Profile version. Please try this version:
Aspose.Cells for .NET v8.7.1.3 and see if makes any difference.

That was it! Thank you for your quick reply & resolution.

Hi,

Thanks for your comment and using Aspose.Cells.

It is good to know that your issue is resolved now. Let us know if you encounter any other issue, we will be glad to look into it and help you further.