473,779 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3387
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="vbscr ipt">
Sub exportbutton_on click
Dim sHTML, oExcel, oBook
sHTML = document.all.it em("dgLogs").ou terhtml

Set oExcel = CreateObject("E xcel.Applicatio n")

Set oBook = oExcel.Workbook s.Add
oBook.HTMLProje ct.HTMLProjectI tems("Sheet1"). Text = sHTML
oBook.HTMLProje ct.RefreshDocum ent
oExcel.Visible = true
oExcel.UserCont rol = 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*******@devd ex.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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*******@devd ex.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******@amerit ech.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
programmaticall y, 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*******@devd ex.com> wrote:

¤ Hi Paul,
¤
¤ Thanks for the response. That's actually good news, because I'm
¤ developing an application that creates Excel XML documents
¤ programmaticall y, 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******@amerit ech.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
7024
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: "\r\n" but the Excel file just loads all the field in one row as if it doesn't recognise these characters. These are the headers I am using to create the file:
9
8900
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 this out of an XML file or Excel Template file. Next I need to convert a dataset to xml and try and transform this data into the users xml file..........i've seen a few things on this but havent had much success...
17
27285
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 machine (NT4, Access 2k), however as soon as I attempt to create anything on another machine (NT4, Access 2k) which most users will be working from, I receive an automation error. The problem line with the code is:
3
1862
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 inside a .NET program? Thanks, Ali
7
412
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 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.
2
2186
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 = objExcel.ActiveWorkbook.ActiveSheet The problem is that every time I need to export, it results in creating
7
2701
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 excel formulas in the excel download, for example a running total on a column, thanks. -- Paul G Software engineer.
1
1620
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 client machine already have excel.so how i can remove Excel.exe while creating setup. pls help me out
1
1655
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 = $Excel->Workbooks->Open("c:/file_excel.xls"); my $Sheet = $Book; I am new to perl.I am trying to create an excel file with the above code, but i am not getting it.Can you help in creating an excel file.
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10075
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.