I am just testing Cell .Net component, but have an issue when “saving” to http response object.
I have following code;
MemoryStream stream = new MemoryStream();
Workbook wkb = ExportService…();
wkb.save(stream, new XlsSaveOptions());
resp.ContentType = “application/vnd.ms-excel”;
resp.AddHeader(“content-disposition”, “inline; filename=Test.xls”);
The issue here is that the excel is launched correctly and the content is fine. But the filename does not become Test.xls. It is the name of my webservice method!.. This is an issue cause when I call the webservice method again the content isnt streamed out as there already exist a file opened with that name.
I also tried to call the save function by;
wkb.save(resp, “Test.xls”, ContentDisposition.Inline, new XlsSaveOptions());
I have also tried to use ContentDispostion.Attachment, but this I cant use as it opens Excel in protected view, which is not fine for me.
I am using Aspose .Cells .Net v. 126.96.36.199 and using the version which are under net2.0 (not the Client profile version!).
Is there a solution to this issue?
Thanks for quick response.
Are you saying that the file that is streamed to response object should be opened correctly,with the given name in header? If so how come it not working for me…Does my code look fine? or is there a way to do it differently?
I am evaluating the product and cant use if I dont have a work around!!