|
Subject:
|
help exporting data to excel
|
|
Posted By:
|
MarkGT
|
Post Date:
|
4/16/2008 12:20:45 PM
|
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 By:
|
mat41
|
Reply Date:
|
4/16/2008 6:04:21 PM
|
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 By:
|
MarkGT
|
Reply Date:
|
4/19/2008 7:48:14 AM
|
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 By:
|
mat41
|
Reply Date:
|
4/20/2008 7:53:20 PM
|
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=en&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=asp+dynamically+populate+combo+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 By:
|
MarkGT
|
Reply Date:
|
4/29/2008 8:31:05 AM
|
Back to the original excel question...I got the:
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 By:
|
mat41
|
Reply Date:
|
4/29/2008 6:13:04 PM
|
;;;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
|