Last post Apr 25, 2012 03:16 PM by CodeHobo
Apr 25, 2012 03:08 PM|Fabio Rodrigo|LINK
I want to generate reports in excel, but I don't have excel installed in the server, then I can't use Microsoft Interop.
I read something about generate XLS file by an XML, but I don't know how to do that.
How can I generate reports in excel, without Excel in the server ? Any Ideas ?
Apr 25, 2012 03:16 PM|CodeHobo|LINK
There's a few ways you can do it. You can actually just create an html page and then set the content type programatically. As long as your data is in an html table it will render correctly in excel. See this blog post on how to do that.
That will generate an excel file, but you will get a warning before opening it. When you open it,
it's a normal file.
Another method is to use a special library. Here's an example that uses a library for generating excel files. I wrote a wrapper around an open source library and it doesn't give you a warning and generates the excel file without excel being installed on
the server. I'll write a blog post later explaining how to use it.