Hi,
I have a scenario where in my aspx page will be calling a wcf service to generate loan file. Now wcf service’s functions is to use aspose.cells to generate a worksheet and send it back to the calling aspx page. The aspx page will then send this file to client browser and then file open prompt will be appear at client browser.
My question is, is this possible? Can somebody provide me a sample code or steps to achieve this task.
Regards
Amit
Hi,
Thanks for your inquiry.
Well, Aspose.Cells for .NET component is pure .NET library that provide a set of APIs for MS Excel spreadsheet management. The component can be used by any technology/solution including simple Desktop application, Asp.NET web applications or by any type of window or web service etc. Some of our existing users are already using it in the traditional asmx services. I think you may try it in your wcf service(s). The service can utilize Aspose.Cells APIs and generate spreadsheets dynamically, you may also stream the workbook and then sends the generated file to the client browser on the fly.
See some documents for reference:
http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net/saving-files.html
http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net/opening-files.html
Thank you.
Thanks Amjad, for your reply. I really appreciate your quick response.
Well one more thing to add to my query is I do not want to use excel or aspose objects in my web application. I just want to use aspose in my my wcf service only. can you throw some light on the performance hit if i send the workbook through the byte array stream from my wcf servbice to web application.
I will not be able to use save to http response function in case of wcf service. So feasible option left is save to stream. Which one would be the best option. memory stream or file stream to send the file to web application from wcf service using net tcp binding and streaming mode option.
what is FileFormatType.Default, i mean it saves the workbook in which version of MS Excel?
Hi,
Well, we think you may use Workbook.SaveToStream method: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net/aspose.cells.workbook.savetostream.html to get the workbook into streams from your service, and the performance would be fine too. Also, if you got sufficient memory, we think MemoryStream would be a better option.
what is FileFormatType.Default, i mean it saves the workbook in which version of MS Excel?
Well, FileFormatType.Default(enum member) refers to MS Excel 2003.
Thank you.