Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 16th, 2008, 06:32 AM
Authorized User
Join Date: Nov 2005
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default Ho to print automatic an excel file from ASP?


I made some ASP webpages (intranet of the company) where the first line has as code
Response.ContentType = "application/vnd.ms-excel"
So when it finished it asks you to see or save the EXCEL file.

What I want to do is that it automatic prints the EXCEL file on the printer of the Server.

How can this be done? I can do it with TXT files, using the "OPENTEXTSTREM" code. But can´t find the way to do it with Excel file.

Any help is welcome,


Old December 17th, 2008, 10:38 PM
Friend of Wrox
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts

Well, the problem is that you did not *REALLY* create an EXCEL file, at all.

You really just created HTML and then you asked MS Office to *interpret* the HTML *AS IF* it contained cells in an Excel spreadsheet.

So it's not REALLY an Excel *FILE* until and unless the user SAVES it as such on his/her client computer.

But I don't get it.

If all you want to do is print the "grid" of an excel-style spreadsheet, why does it ever *NEED* to be converted to Excel, at all??? Why can't you just print the HTML???
Old December 23rd, 2008, 05:24 PM
Registered User
Join Date: Oct 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

You have to make an html page with the data you need and print it, instead try to print an excel. ok?

best regards.

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Print A Txt File in AsP.net msridharps ASP.NET 2.0 Basics 0 December 16th, 2008 04:40 AM
How to print data from Report into file Excel?? wwwmdang1983 VB How-To 2 June 16th, 2006 08:45 PM
Print file at client side in asp.net manish.sharma04 ASP.NET 2.0 Basics 0 April 4th, 2006 08:46 AM
how to print a file targated by a hyperlink in asp pinkuisadear Classic ASP Basics 0 April 15th, 2005 01:35 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.