Hello I would like to know if there is a webpage or something else (even another thread in this forum) where there''s an explanation (preferably simple and detailed)on how to export data from a rail application to a .doc or a .xls. I have read Agile Web, Rails recipes and a few threads in this forum but I don''t know how to do it. Where is stored the model document ? How to choose the data to export ? I will read a bit more about send data or CSV, but these are quite unknown to me. Thanks for the reply. -- Posted via http://www.ruby-forum.com/.
Please do not send unsolicited mail to wku.edu email accounts. If you feel that your message was rejected in error please contact 270-745-7000
On Wed, 2006-06-28 at 23:58 +0200, Cl?lia Nev wrote:> Hello > > I would like to know if there is a webpage or something else (even > another thread in this forum) where there''s an explanation (preferably > simple and detailed)on how to export data from a rail application to a > .doc or a .xls. I have read Agile Web, Rails recipes and a few threads > in this forum but I don''t know how to do it. > Where is stored the model document ? How to choose the data to export ? > I will read a bit more about send data or CSV, but these are quite > unknown to me.---- I found it easiest to completely sidestep the issue and incorporated the following two lines of code in a controller... mytext = render :action => ''client_list_all_export'' send_data mytext, :type => ''application/vnd.ms-excel'', :disposition => ''inline'' which ultimately opened an excel spreadsheet with the data/format of my ''client_list_all_export.rhtml'' view file directly - it was so cool that I almost fell out of my chair. YMMV Craig
> I found it easiest to completely sidestep the issue and incorporated the > following two lines of code in a controller... > > mytext = render :action => ''client_list_all_export'' > send_data mytext, :type => ''application/vnd.ms-excel'', :disposition > => ''inline'' > > which ultimately opened an excel spreadsheet with the data/format of my > ''client_list_all_export.rhtml'' view file directly - it was so cool that > I almost fell out of my chair. > > YMMV > > CraigThanks, I have tried this way just now, and it seemed to work quite fine. Since I don''t want to spend hours thinking about another way, I''ll stick with this method. Thanks a lot, Cl?lia -- Posted via http://www.ruby-forum.com/.