Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

How to create Excel Doc on the fly from web apps?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
harifajri@gmail.com - 03 Sep 2007 10:37 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.