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 April 16th, 2008, 12:20 PM
Authorized User
 
Join Date: Apr 2008
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default help exporting data to excel

Hi,

I have an asp page that displays query results in a datagrid. Id like to add a button to the datagrid to allow the user to view the data in a pre-formatted excel spreadsheet so it looks nicer and automatically creates graphs and charts.

How do I go about exporting the datagrid data to the pre-formatted excel spreadsheet (in the cells that I specify)?

thanks

 
Old April 16th, 2008, 06:04 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

You say datagrid - This sounds like a .net question to me. Are you .neting? If so this is the classic ASP area of worx. If not I use:

Response.ContentType = "application/vnd.ms-excel"

to achieve this, it works very well. Throw the above syntax into Google you will come up with useful links liek the following which holds your solution:

http://www.15seconds.com/issue/970515.htm

Wind is your friend
Matt
www.elitemarquees.com.au
 
Old April 19th, 2008, 07:48 AM
Authorized User
 
Join Date: Apr 2008
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes its classic asp. I was mistaken, it is not a data grid. I'm just learning asp. Thank you for the help.

I have another question. I currently have four drop down lists that are independently populated by sql statements. How do I go about making the second list populate based on the selection from the first list, the third based on the selection from the second list and finally the fourth based on the selection from the third lst?

 
Old April 20th, 2008, 07:53 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I use the onChange / post and reload event inside the select tag. There is a smarter way to get this done without reloading the page. Google knows loads of options:

http://www.google.com.au/search?hl=e...+boxes&spell=1

IMO start another post so others may benefit. knowbody will look here for that solution given the title of this post

Wind is your friend
Matt
www.elitemarquees.com.au
 
Old April 29th, 2008, 08:31 AM
Authorized User
 
Join Date: Apr 2008
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Back to the original excel question...I got the:

Code:
Response.ContentType = "application/vnd.ms-excel"
to work, but it doesn't do what I need. I need the excel file to be pre formatted so charts and graphs are automatically created.

Is it possible run queries on an asp page and send the data to specific cells in an excel file that has already been created?


 
Old April 29th, 2008, 06:13 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;I need the excel file to be pre formatted so charts and graphs are automatically created
I am unaware of a way to create charts and graphs in the way you describe. You can however load images of charts and graphs of course

;;Is it possible run queries on an asp page and send the data to specific cells in an excel file that has already been created?
No sure about that one, I have never had this need. Here is a useful link for you:

http://www.greggriffiths.org/webdev/both/excel/

Wind is your friend
Matt
www.elitemarquees.com.au





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data to Excel lrickett Beginning VB 6 3 February 10th, 2011 01:27 AM
Exporting data from datagrid to excel??? twyce C# 3 March 4th, 2010 04:51 AM
Exporting Query Data From Access to Excel JimInSouthernCal Access VBA 3 December 21st, 2007 08:34 AM
Exporting data to excel sheet x_ray VB.NET 2002/2003 Basics 0 January 6th, 2006 03:14 PM
Exporting data from a repeater to an Excel sheet see07 ASP.NET 1.x and 2.0 Application Design 7 January 17th, 2005 03:46 PM





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