Browse the Ruby on Rails Community.

You are here: Forums Ask a Rails expert creating and exporting Excel s...

Replytotopic

creating and exporting Excel sheet in rails

Posted in Forums : Ask a Rails expert

 
Profile

Authority 0
Posting Rating 12
Sign in to rate this post

Hello,

I am very new Rubyonrails.
I want to write data to excel sheet and export it..

I am uings spreadsheet-excel-0.3.5.1

please help me out..If possoble explian me in clear steps..
very urgent please

Thanks in Advance.

Sai

 
Profile

Authority 12
Posting Rating 95
Sign in to rate this post

Use FasterCSV.Install this using

gem install fastercsv

For info on usage please refer
http://wiki.rubyonrails.org/rails/pages/HowtoExportDataAsCSV

 
Profile

Authority 12
Posting Rating 76
Sign in to rate this post

Fastercsv gem is used like this
send_data csv_string, :type => ‘text/csv’, :filename => (params[:batch] + ’ ’ + params[:method].capitalize + ’ Export.exl’)
You can export data in any formet

 
Profile

Authority 0
Posting Rating 12
Sign in to rate this post

Thank U soo much .

 
Profile

Authority 25
Posting Rating 98
Sign in to rate this post

I just want to add that if your users are on IE then you can simply use a mime type of ‘application/vnd.ms-excel’ and used a table in the body and it will automatically load in Excel in the browser. This works well in a controlled environment like a company where every workstation has MS Office or a similar arrangement. It’s very slick and easy. You can even use javascript to launch the save or print window from this point which prompts the user to take action.

I haven’t tried this with Firefox and MS Office but I don’t think this will work.

 
Profile

Authority 0
Posting Rating 12
Sign in to rate this post

Hello MR Raul Rubio,

Thanks for your info.
Actually I am very new to rubyonrais..just started to learn to work on rubyonrails.

I am not able to find a good book for rubyonrails here in Indian market.
If possible can you please help me out in working with excel in rails..If you have any good tutorial please send me..

Thanks
Sai

Replytotopic

Other Recent Topics

Ask a Rails expert : First post, requesting sage perspective

Ask a Rails expert : How to use mephisto

Ask a Rails expert : How to use mephisto

Ask a Rails expert : will_paginate customization problem

Ask a Rails expert : BackgroundRB still wants 'development' environment...?

Ask a Rails expert : activescaffold, sql exception

Ask a Rails expert : Passing non-english chars in query string

Ask a Rails expert : Rails and 2D barcodes

Ask a Rails expert : apache giving proxy error

Ask a Rails expert : Custom Responses w/ 'extra' information...?

Formatting Help
  • *bold*       _italics_      
    bq. (quotes)
  • "DSC":http://www.dsc.net
  • * or # (lists)
or cancel