[nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread xmilliard
Example from ya-csv test to write file : https://github.com/koles/ya-csv/blob/master/test/echo.js Xavier On 20 juin, 13:42, ravi prakash wrote: > Hi Andrew, > >    You really solved my problem. >    One more help, I went through ya-csv module and was able to upload > and parse csv file. >    Bu

[nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread xmilliard
+1 for ya-csv Xavier On 20 juin, 07:47, Matthew Vickers wrote: > I have used ya-csv in the past, it works well for our basic usage. > > https://github.com/koles/ya-csv > > Matt > > - "ravi prakash" wrote: > > > > > > > > > Hi group, > > > How can i generate a excel/csv file from nodejs appl

[nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread Brandon Griggs
I also couldn't find a node plugin that wrote CSV files, but there's not much to it (open any CSV in a text editor you can see how simple it is). So write quick function to surround your values with quotes, escape the inner quotes, and put each row on a new line ("\r\n"). Then write or strea

Re: [nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread Andrew Stone
Ravi, Sorry I can't help you there. I just thought it looked cool from Matt's link. On Wed, Jun 20, 2012 at 2:31 AM, Matt Freeman wrote: > headers have to be set first as you wont be buffering the whole response. > > On 20 June 2012 13:24, ravi prakash wrote: >> >> Hi Andrew, >> >>  Thanks for

Re: [nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread Matt Freeman
headers have to be set first as you wont be buffering the whole response. On 20 June 2012 13:24, ravi prakash wrote: > > Hi Andrew, > >  Thanks for your quick response. I tried your first option. >  Say, i have data from database in array called results, > >  for(var i = 0; i < results.length; i+

[nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread ravi prakash
Hi Andrew, You really solved my problem. One more help, I went through ya-csv module and was able to upload and parse csv file. But i did not understand how i could create a csv using ya-csv module. Can you please provide me sample code to create csv using ya-csv. Once again thanks

[nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread Oleg Efimov (Sannis)
You should send headers before any page/file output - this is same for all languages and caused by HTTP protocol format. среда, 20 июня 2012 г., 10:24:42 UTC+4 пользователь ravi prakash написал: > > > Hi Andrew, > > Thanks for your quick response. I tried your first option. > Say, i have da

[nodejs] Re: Generate Excel/CSV files

2012-06-20 Thread Ryan Schmidt
Capitalization of header names should not matter to well-behaved user agents. Capitalizing each word of the header name is preferred. Content-Disposition. Content-Type. On Jun 20, 2012, at 01:43, Andrew Stone wrote: > Your for loop look fine, but I believe you messed up the headers. > Don't cap

Re: [nodejs] Re: Generate Excel/CSV files

2012-06-19 Thread Andrew Stone
Hi Ravi, Your for loop look fine, but I believe you messed up the headers. Don't capitalize them. Also, the 'content-disposition' header is a bit of an anomaly. It just doesn't look right to most programmer's eyes, and I've screwed it up also resulting in no file download. It cannot have any (unes

[nodejs] Re: Generate Excel/CSV files

2012-06-19 Thread ravi prakash
Hi Andrew, Thanks for your quick response. I tried your first option. Say, i have data from database in array called results, for(var i = 0; i < results.length; i++) { body = ''; body = results[i]+'\n'; res.write(body); } res.setHeader('Content-disposition', 'att