473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating Excel with asp.net

Hello,

I've written an asp.net application that creates Excel documents. It
works by creating an excel document in XML format.

But I wonder if I'm reinventing the wheel. I know that there are ways to
read and write Excel files with ADO, but as far as I can tell, it
doesn't provide the flexibility I need. I need to be able to generate
tabs, cell formatting, formulas, etc.

Is there a better way to dynamically create an excel file from scratch
on an asp.net web server, through automation or otherwise? Are there any
open source projects that deal with this?

Thanks,
Jason

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #1
5 3344
If you want to install Excel and adjust the security settings somewhat, you
can definitely do it through automation. I use VBSCript and just output
the contents of a datagrid to excel, but this is really limited in terms of
formatting and since I'm not using Automation , formatting is lame.

Another choice is FarPoint's Spread. I've used it extensively and it has a
desktop and a web version. If you get it from www.xtras.net I think the
xtras subscription will pay for itself.
http://www.xtras.net/products/spreadwebforms.asp You don't need excel at
all but you want easily write to the native Excel format and you have
unbelievable power over it, in addition, users can use the Spread control
within a browser and you can use stuff like VLOOKUP and a whole lot of other
neat stuff on the browser - which is amazing b/c the user nor the server
need Excel. I do a fair amount of work and reviewing of third party tools
and Spread is without a doubt one of the finer tools I've encountered.
Everything Mike has over there is top notch and he's pretty anal about who
he features so if you have a few extra bucks, it's well worth the
investment.

If you just want to output a grid to excel though, you can set your
formatting in the grid stick a button on the form (HTML) and then just
invoke this <script language="vbscript">
Sub exportbutton_onclick
Dim sHTML, oExcel, oBook
sHTML = document.all.item("dgLogs").outerhtml

Set oExcel = CreateObject("Excel.Application")

Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML
oBook.HTMLProject.RefreshDocument
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>
</body>
</HTML>

HTH,

Bill

--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
"Guy Incognito" <an*******@devdex.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

I've written an asp.net application that creates Excel documents. It
works by creating an excel document in XML format.

But I wonder if I'm reinventing the wheel. I know that there are ways to
read and write Excel files with ADO, but as far as I can tell, it
doesn't provide the flexibility I need. I need to be able to generate
tabs, cell formatting, formulas, etc.

Is there a better way to dynamically create an excel file from scratch
on an asp.net web server, through automation or otherwise? Are there any
open source projects that deal with this?

Thanks,
Jason

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #2
Hi William,

Thanks for your reply.

The VBSCript solution isn't flexible enough for what I need. My asp.net
application creates a complicated spreadsheet with multiple tabs,
formulas and lots of cell formatting.

It creates the spreadsheet as an XML document on the server and
downloads it to the client.

I've found commercial software (like ExcelWriter) that can create
spreadsheets on the server, but so far, I've found nothing for free.
What I want is to make sure that there isn't some easy alternative to
using XML to generate Excel spreadsheets.

Thanks,
Jason

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
On Wed, 26 May 2004 07:38:14 -0700, Guy Incognito <an*******@devdex.com> wrote:

¤ Hello,
¤
¤ I've written an asp.net application that creates Excel documents. It
¤ works by creating an excel document in XML format.
¤
¤ But I wonder if I'm reinventing the wheel. I know that there are ways to
¤ read and write Excel files with ADO, but as far as I can tell, it
¤ doesn't provide the flexibility I need. I need to be able to generate
¤ tabs, cell formatting, formulas, etc.
¤
¤ Is there a better way to dynamically create an excel file from scratch
¤ on an asp.net web server, through automation or otherwise? Are there any
¤ open source projects that deal with this?
¤

The simple answer is no. The only tool I am aware of that can provide this level of control over the
presentation of the data is the Excel application itself.
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #4
Hi Paul,

Thanks for the response. That's actually good news, because I'm
developing an application that creates Excel XML documents
programmatically, and hope to distribute it as an open source project.

However, I'm a little concerned about the lack of documentation for
SpreadsheetML, the XML language that describe Excel spreadsheets. I've
found documentation for the language's basic features, but it's
incomplete. I've had to figure out the more advanced features by adding
them in Excel and reverse engineering them from the resulting XML
document.

Does anyone know (or care to speculate) why complete documentation of
SpreadsheetML isn't available? Should I be reasonably confident that it
will be upwardly compatible with future versions of Excel?

Or is there more complete documentation somewhere that I've missed?

Thanks,
Jason

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5
On Thu, 10 Jun 2004 08:26:19 -0700, Guy Incognito <an*******@devdex.com> wrote:

¤ Hi Paul,
¤
¤ Thanks for the response. That's actually good news, because I'm
¤ developing an application that creates Excel XML documents
¤ programmatically, and hope to distribute it as an open source project.
¤
¤ However, I'm a little concerned about the lack of documentation for
¤ SpreadsheetML, the XML language that describe Excel spreadsheets. I've
¤ found documentation for the language's basic features, but it's
¤ incomplete. I've had to figure out the more advanced features by adding
¤ them in Excel and reverse engineering them from the resulting XML
¤ document.
¤
¤ Does anyone know (or care to speculate) why complete documentation of
¤ SpreadsheetML isn't available? Should I be reasonably confident that it
¤ will be upwardly compatible with future versions of Excel?
¤
¤ Or is there more complete documentation somewhere that I've missed?
¤

Did you download the following:

Office 2003 XML Reference Schemas
http://www.microsoft.com/downloads/d...displaylang=en
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeremy Langworthy | last post by:
Hi I am trying to create a MS Excel format CSV but I can't figure out how to get the line feed/carriage return/new record working properly. I am nding each line/record with these characters:...
9
by: Paul | last post by:
Hi all Arggghhh........... The problem.....I want the user to be able to create an excel document and name particular cells in the document where they want the data to be placed and then save...
17
by: Ange T | last post by:
Hi there, I'm having pain with the VB behind an Access form. The form is used to create reports in Excel based on the details entered in the form. This has always worked without error on my...
3
by: A.M | last post by:
Hi, Using ASP.NET/VB.NET and SQL Server backend, I need to return calculation results to user as an Access MDB file or Excel XLS sheet. What would be the best way to create a MDB or XLS file...
7
by: Guy Incognito | last post by:
Hello, I've written an asp.net application that creates Excel documents. It works by creating an excel document in XML format. But I wonder if I'm reinventing the wheel. I know that there are...
2
by: leeedw | last post by:
Hi everyone, I use the following code whenever I export to Excel from VB.NET objExcel = New Excel.Application() objWorkBooks = objExcel.Workbooks objWorkBook = objWorkBooks.Add objWorkSheet...
7
by: Paul | last post by:
Hi I have created an excel file download feature within a .net application using Microsoft Office XP primary interop assembly for excel. I was just wondering if anyone knows if you can also embed...
1
by: vijay | last post by:
HI all, I have done a C#.net windows application and used Microsoft Excel 11.0 object library.My problem is while creating setup of my project it include Excel.exe which has big size.But...
1
by: amarnathreddy | last post by:
#!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); my $Book =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.