Free Support Forum - aspose.com

Saving Workbook to HTTPResponse

I am using aspose cells build 5.2.2.0 and i cannot find a method which allows me to save a workbook to a HTTPResponse as i have done in 4.9.1.0, is this no longer supported?

Hi,

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();

Thanks for your quick response. However, there are no overloads available which accept a HTTPResponse. I am using the 5.2.2.0 version of Aspose.Cells. I am using .Net framework 3.5 and the component description is ‘Aspose.cells for .Net Frame Client Profile’ if that helps

Hi,

Please make sure, you are using the right dll.

Please use the DLL under the directory “net2.0” and not “net3.5_ClientProfile”.

And please check the readme.txt under the directory
“Bin”.

Please see this image for more help.



Thanks, that worked