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 February 25th, 2010, 04:02 PM
Authorized User
 
Join Date: Apr 2009
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
Default Outputing to different Excel worksheet

I can successfully output my .asp table to an Excel spreadsheet, but what I need to do is to be able to output to a specfic worksheet in the spreadsheet.

The end user needs a one click answer to his problem.

I generate the raw data then two different summary pages, all need to be in the Excel spreadsheet.

End product would have the following tabs;
Summary 1,
Summary 2,
Raw Data

I'm outputing with the following code;
Code:
<%
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "attachment;filename=whatEver.xls"


Thank you for your help

 
Old February 25th, 2010, 05:22 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Nope, not when you create the Excel that way.

See, you aren't *really* creating Excel data when you use the ContentType stuff. You are really just telling the *browser* that you want it to *TREAT* your data as Excel data. And so then the browser invokes the Excel plugin (if it exists! what about people who don't have Excel on their computers?) and says "here's the data". And you really don't even have control over what worksheet the data goes into.

If you really need to create a ".xls" file with multiple sheets, you will have to do it all server-side, creating and writing to Excel directly from your ASP code. That's not as easy.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Reflecting changes in Excel Worksheet...???? hunk1985 General .NET 0 September 12th, 2007 06:29 AM
How to continue to next new excel worksheet christine_wmw Classic ASP Basics 0 January 24th, 2007 02:54 AM
Convert an Excel worksheet to xml bluesockets XML 1 November 23rd, 2006 10:46 AM
DYNAMIC EXCEL WORKSHEET NAME?? tbaquero Classic ASP Professional 2 October 5th, 2004 08:30 AM
Opening excel worksheet in c# GanpatDSouza C# 1 January 23rd, 2004 03:53 PM





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