Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
downloading a table of data
Old 11-15-2005, 08:45 AM downloading a table of data
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi,

I have a table on a web page that i wish the user to be able to save to his computer.

I don't want all the navigation or footers that are saved if you use save page as.

JUST THE TABLE

How do i do this please.

Cheers

Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 11-15-2005, 09:02 AM
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
How about a link that links to a page the only outputs the table?
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 11-15-2005, 09:35 AM
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Did a Google search...
http://www.codeproject.com/aspnet/Ex...ort_button.asp

Here is one from Expert Exchange (please know that I did not write this and take no credit, visit the link below for the full thread)...
http://www.experts-exchange.com/Web/..._21288109.html
Quote:
Here's how i usually create CSV file and some simple sample codes.


<%
'sOutput stores the final output
'sData stores each line output

'==== write the title (name of the column) ===
sData = Chr(34) & "First Name" & Chr(34) & ","
sData = sData & Chr(34) & "Last Name" & Chr(34)

sOutPut = sOutPut & sData & vbCrLf

'===== now output 1 line of data =======
sData = Chr(34) & "John" & Chr(34) & ","
sData = sData & Chr(34) & "Doe" & Chr(34)

sOutPut = sOutPut & sData & vbCrLf

FileName="myTestFile.csv" 'default file name

Response.Clear
Response.ContentType = "text/csv"
Response.AddHeader "Content-Disposition", "filename=" & FileName & ";"
Response.Write(sOutPut)
%>

in your actual code, you would replace the "output 1 line of data" part with a recordset loop to output all your records (which means you would have to run the same query).
In your main page where you display the records in html, you can add a submit button for export to CSV. When you submit the form to create CSV, it should open a dialogue for "save as", and then you can save the csv file in your local machine.

have not tried FtB's way before. I might try it the next time i work on csv export

kingsfan
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 11-15-2005, 12:22 PM
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Sorry for posting again (slow day)... I found a DW extension that will download to CSV. I haven't used it, but this site is usually reliable for this sort of thing.

http://www.basic-ultradev.com/articl...ion/index.html
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Reply     « Reply to downloading a table of data
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13576 seconds with 12 queries