Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Excel Documents with ASP 1

Status
Not open for further replies.

ToddWW

Programmer
Mar 25, 2001
1,073
0
0
US
Here are three of the best articles that I know of explaining the different ways you can create and send Excel Files with ASP. They provide excellent example code and the third article shows how to automate Excel on the client's machine. Very cool.. (For Now) :)

Article #1: Gives example code and shows how to stream a Basic Excel Worksheet to the browser. (Excel 97 and up)



Article #2: Gives example code and shows how to stream a formatted Excel Workbook (with multiple worksheets) to the browser. (Excel 2000 and up)



Article #3: Gives example code on how you can actually launch your visitor's Excel Software using client side VBScript, create worksheets, and populate the worksheets with data, charts and even graphs. (Very Cool) (Excel 97 and Up)



Once you get the hang of it, here's what I like to do. I go to Excel and create the look and feel of the worksheet that I want ASP to generate. Then I save that worksheet / workbook as an HTML document. View the source of the HTML document and have ASP copy that format.

Happy Excelling :)

ToddWW
 
Good links, this is probably a stupid question but, is it possible to get similar results without the client having Excel installed, i.e. only having Excel installed on the web server and streaming it thru from there? I wouldn't like to rely on the client having Excel installed.
 
I'm not aware of anything that will allow you to do that. Especially Microsoft's licensing team !!

Sorry :-(

ToddWW
 
Microsoft does not support automation on the server side in a client-server environment. They claim it was never designed to work that way and that you can hang things up if you end up doing something that would require interaction.

I managed to get server-side automation to work once and then we installed an Office 2000 service pack and it no longer worked. When I called Microsoft, they said they didn't support server-side automation. They mentioned it could have been DCom settings that changed, but they couldn't really tell me what I could do to get the server-side automation working again.

What I did to counteract the possibility that the client might not have Excel was I wrote some code that exported the data to tab-delimited text. That way, if the client didn't have Excel, they could at least get the data in tab-delimited text and then do whatever they wanted with it.

Good luck,
Ann

 
To answer yogi77's question. There isn't anything that would let you do that unless you had a Microsoft Office Document Viewer installed (or another 3rd party document viewer that views Excel, which exist). The problem is that your browser is sending a created "Excel" file down to the client. The client has to have Excel (or a document viewer) installed to know how to render the file, otherwise you'd just get a bunch of code that wouldn't make sense. It'd be similiar to trying to open a gif file in Notepad. It just doesn't know how to render the file. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Ann,

Thanks for the input on Excel automation. What are your thoughts on this article, last updated June, 2001.

HOWTO: Automating Excel From Client-Side VBScript

I'm seriously considering using this automation. I realize that the client side VBScript is limited to IE browsers, but that's an issue we're willing to deal with.

I would like to know, however, if there are problems that I'm not aware of or that are not mentioned in this article.

Thanks.

ToddWW :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top