Save workbook to an HttpResponse in version 5.1.2.0


Hello,


Today I downloaded version 5.1.2.0 of Aspose Cells for .NET. In my application, I use the method Workbook.Save(HttpResponse response, string fileName, ContentDisposition contentDisposition, SaveOptions saveOptions).

Although this method is still mentioned in the documentation (and not marked as obsolete), I get now a compiler error 'Cannot resolve this method'.

So, how can I save a workbook to an HttpResponse with this new version?


Kr,
Stijn Van Assche

Hi Stijn,

Following code will help you saving the workbook to an HttpResponse:

Code snippet:

Workbook workbook = new Workbook();
//... Your code goes here
//Save in pdf format and send the file to the client browser, he may open the file in
//some application or save it to some location

workbook.Save(this.Response, "Report.pdf", ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Pdf));

Moreover please make sure that your project is referencing the correct version of Aspose.Cells.dll. Because, we have tested saving HttpResponse. It is working fine. In case, if it is not please forward us your project so that we can further test it.

Thanks,


Hello,


The code snippet you posted is exactly the same as I'm using. But the problem is, this method does not seem to exist anymore in version 5.1.2. I downloaded this version via: http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry253739.aspx.


Kr,
Stijn Van Assche

Hi Stijn,

If you are building a web application, please use the Aspose.Cells.dll in the Net2.0 directory.

The dll in net3.5_ClientProfile directory is used only for the console application with Net frame client profile. Please check your project, it is possible that your project is referencing this dll. For complete reference, please read the readme.txt file in the bin directory.

Thank you.


Hello,


It seems that I overlooked the Net2.0 files... Using this version solved the problem.

Thank you!


Kr,
Stijn Van Assche