reference from NS220
Export data to CSV file (two ways)
原文:http://www.cnblogs.com/markOfNick/p/3548019.html