This still isn't working for me. I'd like to put this in the FAQ, and talk with Lars about documenting this for list-builder. Any other suggestions? The other threads in the link Dave suggested either use deprecated procs, or don't explain what they do (using .vuh files for example) or seem too complicated (using the .vuh files for example).
It displays on the screen very nicely, just doesn't pop up in Excel.
set csv [list::write_output -name pan]
set outputheaders [ns_conn outputheaders]
ns_set cput $outputheaders "Content-Disposition" "attachment; filename=pan.csv"
doc_return 200 "application/text" "$csv"