473,385 Members | 1,907 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,385 software developers and data experts.

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 9189
"Chase Kang #52" <ch********@gmail.comwrote in message
news:11*********************@h40g2000cwb.googlegro ups.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********@gmail.comwrote in message
news:11*********************@h40g2000cwb.googlegro ups.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********@gmail.comwrote in message
news:11*********************@v33g2000cwv.googlegro ups.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********@gmail.comwrote in message
news:11*********************@v33g2000cwv.googlegro ups.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********@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.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
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...
5
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...
8
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...
7
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...
4
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...
1
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...
7
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...
1
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...
3
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...
2
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.