The docs state "The maximum number of visible columns is 64 " which isn’t a huge problem, but I have a listbox with 167 columns and when I try to save it as a tab-delimited text file use the old faithful:
Dim excelOut As TextOutputStream
Dim dlg as New SaveAsDialog
Dim f as FolderItem
dlg.InitialDirectory=SpecialFolder.Desktop
dlg.promptText="Save Text As"
dlg.SuggestedFileName="My Text Out.txt"
dlg.Title="Text Output"
f=dlg.ShowModal()
If f <> Nil then
excelOut = TextOutputStream.Create(f)
if excelOut <> nil then
excelOut.Write ComposerStatementList.Heading(-1)
excelOut.Write CHR(9)+CHR(13)
excelOut.Write ComposerStatementList.cell(-1,-1)
excelOut.Close
end if
Else
//user canceled
End if
it only exports the first 64 columns. Anyone know a workaround?
My guess us you DON’T have a Listbox with 167 columns, but a normal LisBox with 64 column and a data structure with 167 colums that fills the Listbox as required.
So obviously you then need to export the data structure and not the Listbox.
Cheers Dave - this worked (but sadly not for the headers but I can live with that on this occasion)
for r = 0 to SMListBox.ListCount - 1
for c = 0 to 166
excelOut.Write SMListBox.cell(r,c)
excelOut.Write CHR(9)
next c
excelOut.Write CHR(13)
next r
excelOut.Close
[quote=199129:@Emile Schwarz]DO YOU KNOW ABOUT:
And for the Headers, scan them and write them do disk (or better, save the real string used to set the Headers) [/quote]
This did the trick for me (I’d entered them in the Inspector)
Check that in TextOutputStream.WriteLine and if by bad luck, this does not made the trick, you can change the Delimiter property ONCE, then use the standard WriteLine.
This is just one line, one clear line instead of three.
At last, I do that and you are free to code as you want.
BTW: I just realize: you end your saved line with a Tab + a Return ?