Hi,
i can generate an excel doc from console apps using C#
and by using the following :
using Microsoft.Office.Interop.Excel;
using System.Reflection;
using System.Runtime.InteropServices;
How do i create Excel Doc on the fly from web apps?
Rgds
HF
Patrick Steele - 03 Sep 2007 14:40 GMT
> Hi,
>
[quoted text clipped - 5 lines]
>
> How do i create Excel Doc on the fly from web apps?
To be honest, you really shouldn't:
"All current versions of Microsoft Office were designed, tested, and
configured to run as end-user products on a client workstation. They
assume an interactive desktop and user profile, and do not provide the
level of reentrancy or security that is necessary to meet the needs of
server-side components that are designed to run unattended."
http://support.microsoft.com/kb/257757/en-us

Signature
Patrick Steele (patrick@mvps.org)
http://weblogs.asp.net/psteele
Mark Rae [MVP] - 03 Sep 2007 15:59 GMT
> i can generate an excel doc from console apps using C#
> and by using the following :
[quoted text clipped - 3 lines]
>
> How do i create Excel Doc on the fly from web apps?
As Patrick has said, don't even consider using server-side Office
automation - Microsoft don't support it because it doesn't work...
Fortunately, creating Excel documents from ASP.NET (which I assume is what
you're using) is fairly simple:
1) Use HTML
Create an HTML document and give it a .xls extention - Excel will treat it
like a native Excel document. This is very simple and (obviously) free, but
you are limited to a single worksheet.
2) Use OpenXML
http://www.microsoft.com/downloads/details.aspx?FamilyID=fe118952-3547-420a-a412
-00a2662442d9&displaylang=en
http://www.microsoft.com/downloads/details.aspx?familyid=15805380-f2c0-4b80-9ad1
-2cb0c300aef9&displaylang=en
Again, this is free, but is not for the faint-hearted... However, it will
allow you to create multi-sheet workbooks
3) Use Aspose
http://www.aspose.com/Products/Aspose.Cells/Default.aspx
This is by far the simplest solution, but it's a commercial product...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net