Real Software Forums
http://forums.realsoftware.com/

Web: Export Listbox to .TXT
http://forums.realsoftware.com/viewtopic.php?f=23&t=45705
Page 1 of 1

Author:  alexandersazu [ Wed Oct 24, 2012 2:34 pm ]
Post subject:  Web: Export Listbox to .TXT

I have problem , i want to export the listbox a file .TXT in the application for web

Author:  neonash7777 [ Wed Oct 24, 2012 3:14 pm ]
Post subject:  Re: Web: Export Listbox to .TXT

alexandersazu wrote:
I have problem , i want to export the listbox a file .TXT in the application for web



Loop through the listbox adding all of it's information to a string
dim s as string
For r as integer = 0 to lb.rowcount -1
dim row() as string
For c as integer = 0 to lb.columncount - 1
row.Append(lb.Cell(r,c))
Next
s = s + Join(row,",") + EndOfLine.Windows
Next



Then have the user download the file
file = new WebFile
file.mimetype = "text/plain"
file.forcedownload = true
file.Filename = "filenamehere"+".txt"
file.Data = stringWithDataInIt
showurl(file.url)

file should be a property on your page so that it stays around long enough for them to download it. You can add it to the session if you want them to be able to leave the page and continue downloading

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/