Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 16th, 2008, 12:20 PM
Authorized User
 
Join Date: Apr 2008
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old April 16th, 2008, 06:04 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #3 (permalink)  
Old April 19th, 2008, 07:48 AM
Authorized User
 
Join Date: Apr 2008
Location: , , .
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?

Reply With Quote
  #4 (permalink)  
Old April 20th, 2008, 07:53 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #5 (permalink)  
Old April 29th, 2008, 08:31 AM
Authorized User
 
Join Date: Apr 2008
Location: , , .
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?


Reply With Quote
  #6 (permalink)  
Old April 29th, 2008, 06:13 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data to Excel lrickett Beginning VB 6 3 February 10th, 2011 12:27 AM
Exporting data from datagrid to excel??? twyce C# 3 March 4th, 2010 03:51 AM
Exporting Query Data From Access to Excel JimInSouthernCal Access VBA 3 December 21st, 2007 07:34 AM
Exporting data to excel sheet x_ray VB.NET 2002/2003 Basics 0 January 6th, 2006 02: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 02:46 PM



All times are GMT -4. The time now is 02:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.