NPOI return path to backbone

Jan 10, 2013 at 10:32 AM

Hi all,

Firstly, I must say NPOI is an awesome API which simplified a lot for me. I am creating my application using C# and rendering my views on the client side using Backbone.js. I previously did my export function using only C#, but I was not able to style my sheet. It was then that I was introduced to NPOI. 

My problem, however, is that I need to create the path to newly created file. Is there a way to configure NPOI to save to a directory of my choosing?

MemoryStream WriteToStream() {           

//Write the stream data of workbook to the root directory           

MemoryStream file = new MemoryStream();           

hssfworkbook.Write(file);           

return file;       

}

As I am not using apsx pages, I cannot use System.Web.UI.Page.

In my backbone template, I am expecting a the file URL from this NPOI class. How do I achieve this?

Your help will be greatly appreciated..