473,625 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export Data to Excel Using ASP.NET without Server-side install

Using VB.NET, I've created a report that takes data from a stored
procedure, which goes into some aspx page controls, and inserts that
data into a pre-formatted Excel spreadsheet template by using Office
2003 COM objects. Unfortunately, I just found out that I can't install
Office on the server, so I need an alternative method. The report
needs to be in a certain format with specified fonts, bolds, colors,
etc..

Is there any way I can still create the Excel report without an install
to the server? I think I can assume the end-user will have Office on
his/her computer.

Dec 30 '06 #1
5 9203
"Chase Kang #52" <ch********@gma il.comwrote in message
news:11******** *************@h 40g2000cwb.goog legroups.com...
Unfortunately, I just found out that I can't install Office on the server,
Lucky you! Server-side automation is not recommended, and any solution which
uses it wouldn't be supported by Microsoft anyway...
http://support.microsoft.com/default...US;q257757#kb2
so I need an alternative method.
No problem.
The report needs to be in a certain format with specified fonts, bolds,
colors,
etc..
No problem.
Is there any way I can still create the Excel report without an install
to the server?
Yes.

1) Create the report in HTML and give it a .xls extension.

2) Create the report in Excel XML - download the schema here:
http://www.microsoft.com/downloads/d...displaylang=en

3) Use this:
http://www.aspose.com/Products/Aspos...s/Default.aspx

While you're there, click the "Why Not Automation?" hyperlink...
I think I can assume the end-user will have Office on
his/her computer.
If not, they can install this:
http://www.microsoft.com/downloads/d...displaylang=EN
Dec 30 '06 #2
Thanks for the reply. I've been looking into option 2 for a while, but
it looked a pain in the you know what so I haven't had to resort to it
yet. I'll take a crack at option 1, but if not, then I guess XML is
the way to go. I don't think option 3 is viable since I'd have to go
through a bunch of yellow tape which I don't want to do.

Mark Rae wrote:
"Chase Kang #52" <ch********@gma il.comwrote in message
news:11******** *************@h 40g2000cwb.goog legroups.com...
Unfortunately, I just found out that I can't install Office on the server,

Lucky you! Server-side automation is not recommended, and any solution which
uses it wouldn't be supported by Microsoft anyway...
http://support.microsoft.com/default...US;q257757#kb2
so I need an alternative method.

No problem.
The report needs to be in a certain format with specified fonts, bolds,
colors,
etc..

No problem.
Is there any way I can still create the Excel report without an install
to the server?

Yes.

1) Create the report in HTML and give it a .xls extension.

2) Create the report in Excel XML - download the schema here:
http://www.microsoft.com/downloads/d...displaylang=en

3) Use this:
http://www.aspose.com/Products/Aspos...s/Default.aspx

While you're there, click the "Why Not Automation?" hyperlink...
I think I can assume the end-user will have Office on
his/her computer.

If not, they can install this:
http://www.microsoft.com/downloads/d...displaylang=EN
Jan 3 '07 #3
"Chase Kang #52" <ch********@gma il.comwrote in message
news:11******** *************@v 33g2000cwv.goog legroups.com...
Thanks for the reply. I've been looking into option 2 for a while, but
it looked a pain in the you know what so I haven't had to resort to it
yet. I'll take a crack at option 1, but if not, then I guess XML is
the way to go.
XML is a bit more work, certainly. With HTML you will (AFAIK) be restricted
to 1 worksheet in your workbook, but it's a lot easier to write...

I don't think option 3 is viable since I'd have to go
through a bunch of yellow tape which I don't want to do.
Fair enough - I guess it's pound per poke. With the Aspose product, you get
a totally managed assembly and simply use its methods and properties, just
like any other .NET class, and you get a binary .xls file at the end of it.
Not sure if there is an update to support the new Excel 2007 .xlsx file
format, though...
Jan 3 '07 #4
Right now, I need to do one of two things:
1. Create the report from scratch
2. Open an existing report and editing the contents.

For one of the reports, option 1 is no problem since the report is
pretty plain and simple. I managed to get this one working using the
HTML method you suggested. But for my other report, it's a bit more
sophisticated since it involves multiple spreadsheets. Ideally, I
would like to open a pre-existing Excel file, edit some of the cell
contents, and save the changes, since creating this one from scratch
would be much harder.

How would you go about doing this one? Is there another way rather
than using the XML method?

Thanks for your help Mark. I'm pretty new to the .NET environment, and
even more so to all this Excel import/export stuff, so you've been a
big help.

Mark Rae wrote:
"Chase Kang #52" <ch********@gma il.comwrote in message
news:11******** *************@v 33g2000cwv.goog legroups.com...
Thanks for the reply. I've been looking into option 2 for a while, but
it looked a pain in the you know what so I haven't had to resort to it
yet. I'll take a crack at option 1, but if not, then I guess XML is
the way to go.

XML is a bit more work, certainly. With HTML you will (AFAIK) be restricted
to 1 worksheet in your workbook, but it's a lot easier to write...

I don't think option 3 is viable since I'd have to go
through a bunch of yellow tape which I don't want to do.

Fair enough - I guess it's pound per poke. With the Aspose product, you get
a totally managed assembly and simply use its methods and properties, just
like any other .NET class, and you get a binary .xls file at the end of it.
Not sure if there is an update to support the new Excel 2007 .xlsx file
format, though...
Jan 3 '07 #5
"Chase Kang #52" <ch********@gma il.comwrote in message
news:11******** **************@ 42g2000cwt.goog legroups.com...
How would you go about doing this one? Is there another way rather
than using the XML method?
Aspose.

If you're looking for a justification for the cost of the Aspose software,
ask yourself how long it would take you and/or your colleagues to go down
the XML route and then compare that in terms of salary to the cost of the
Aspose licence(s)...

It's pretty much the industry standard, and is designed *precisely* to solve
the problem you're currently facing...
Thanks for your help Mark. I'm pretty new to the .NET environment, and
even more so to all this Excel import/export stuff, so you've been a
big help.
No problem.
Jan 3 '07 #6

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

Similar topics

6
13127
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel spreadsheet. I'm having trouble with my code at the point at which it hits ".ReadRecords" -- the module just runs and runs without generating anything. I've gotten this code to correctly save .rpt files without any data, but not with data, nor have I been...
5
8667
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but it requires Microsoft Excel installed on every machine with my program. It is not quite convenient to do so. Is there another way to export data to Excel, or how simply create file of Microsoft Excel format from my program (of cause, the format of...
8
2841
by: DC Gringo | last post by:
I have a simple button that should open another window and export a datagrid to an Excel file. I'm getting: "Name 'window' is not declared." What do I need to declare or import? <INPUT ID="Button5" ONCLICK="Button5_Click" NAME="Button5" TYPE="button" VALUE="Export to Excel"> Sub Button5_Click()
7
4907
by: mattmerc | last post by:
Hi all, We have all seen lot of method for exporting datagrids to Excel. I have a slightly different need. I think it should be easy to accomplish but I am not sure how. I would like when a user clicks a button for exporting a datagrid, that the excel file is saved on the server and that it DOES NOT prompt the user to open or save. Here is the code I am using for standard export that prompts the user. Thanks all. Dim...
4
2496
by: Agnes | last post by:
I searched from previous post and got that there is a solution which export the data to export without using Excel auotmation. However, my database is SQL server, How can I amend objCmd.commandTest ?? I try the following insert statment but fail "INSERT INTO SELECT * FROM .;" // Establish a connection to the data source.(copy from previous post)
1
7202
by: JawzX01 | last post by:
Hello All, First, thank you for any help you can provide. I'm trying to do a simple export to excel. I've used the classic code that is all over the internet, and of course it worked without a problem. The problem is that I want to add text above the data grid in the excel sheet. The text already exists on the web page in various panels (there is different text depending on the parameters of the datagrid
7
28890
Merlin1857
by: Merlin1857 | last post by:
Its great producing data for users to look at in your web pages and generally that is sufficient for their needs but sometimes you may want to supply your user with the data in a form they can actually do something more with. This code shows you how to display data from your database and then how to give that data to the user in the form of a useable Excel spreadsheet which they can then take away and play with themselves. The way I have shown...
1
6679
by: DennisBetten | last post by:
First of all, I need to give some credit to Mahesh Chand for providing me with an excellent basis to export data to excel. What does this code do: As the title says, this code is capable of extracting all tables and it's data from any given database! I was searching the net for a program like this, but I didn't come accross any (free) versions. So I decided to write it myself. To get this code to work, you need to add a reference to...
3
7142
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this file but save it as an excel file. The data in this excel file will be imported into an Access database. The
2
6407
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the method.... it creates 6 sheets # region Namespaces using System;
0
8253
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8692
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...
0
8497
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6116
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
5570
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
4089
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...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1499
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.