Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | 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 Search this Thread Display Modes
  #1 (permalink)  
Old November 13th, 2006, 01:03 AM
Authorized User
 
Join Date: Nov 2006
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Classic ASP - how to export data from modal window

Hi there

I have this modal dialog window that shows the first 5 rows of a record set.

There is an Export ALL button so the user doesn't have to scroll through each page to see the result but can just export to a comma-delimited file. The file is .txt (not .csv not .xsl) that just looks as simple as:

LastName,FirstName,EmployeeId
McDonald,Robert,E0001
Wong,Denny,E0002

I thought it is an easy thing, but it feels like it is COMPLETELY IMPOSSIBLE!!

I have no idea how to do that. I'm on a modal window so if I do a <form> and post the action to itself, then a new blank window comes up. But if I don't do a post, I don't know how I can hit this button and then the server can run the data retrieval and send the result back to the client....

All I want to do is that, as soon as the user hits this button, there will be a File SaveAs dialog box comes up that lets the user decide the name and the location, and then the txt file gets downloaded there. NOTE: since the grid shows only the first five rows, I have to call my data retreival process (stored proc in this case) to specify retrieving all rows, so some data exported is not currently in the grid.

Can you suggest how I should go proceed?

Thanks a lot
CC
Reply With Quote
  #2 (permalink)  
Old November 14th, 2006, 09:11 AM
Friend of Wrox
 
Join Date: Oct 2006
Location: Northampton, Northants, United Kingdom.
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Surely if you want the record save by the user then you need to be doing this client-side, rather than server-side. If this is the case tne you would be looking to use javascript to create the file and write the data...

var fs, f;
fs = new ActiveXObject("Scripting.FileSystemObject");
f = fs.CreateTextFile("c:\test.txt");
f.WriteLine ("Hello World");
f = null;
fs = null;

Not going to swear on the above code for writing a file as I haven't tested it, but it should be fine.

Regards,

Sean Anderson
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
CSV files export with Classic ASP, special chars tn_bobbie Classic ASP Basics 1 July 9th, 2015 08:12 AM
Passing data from modal dialog to window. ganga Javascript 1 September 26th, 2006 06:45 AM
Modal Window... babloo81 Javascript 2 February 21st, 2005 07:08 AM
modal window pablens Classic ASP Professional 3 December 28th, 2004 05:28 PM
Modal dialog window eldanh ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2004 02:07 PM



All times are GMT -4. The time now is 05:10 AM.


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