Forum: Ruby on Rails Hi Everyone..

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C6b3fb1b16a9878bc793a90bdc1c9799?d=identicon&s=25 Hema Gonaboina (hema_mca)
on 2008-10-31 14:06
(Received via mailing list)
*I need to generate the Excel Sheet through the Ruby On Rails.I have to
create the excel sheet with the database fields as headers and the data
in
the sheet*

*I installed the required gems...*
* gem install spreadsheet-excel -v = 0.3.5.1*


*and i worte the code as*


* wb = Spreadsheet::Excel.new("E:/RailsApps/application/sample.xls")
  version = Excel::VERSION*
*               f4 = Format.new(:num_format => "d mmm yyyy")
                f5 = Format.new(:num_format => 0x0f)
                wb.add_format(f4)
                wb.add_format(f5)*
*                ws1 = wb.add_worksheet("employee")
                header = ['ID','Name','Designation','Salary','JoinDate']
                    len = header.length - 1
               for k in 0..len do
                 puts "Header of K #{header[k]}"
                 ws1.write(0,k,header[k],f1)
               end

  *
*                rij = 1             #de gegevens worden getoond vanaf
de
2de rij
                ws1.write(rij,0,employee.id)
                ws1.write(rij,0,employee.name)
                ws1.write(rij,0,employee.desg)
                ws1.write(rij,0,employee.salary)
                ws1.write(rij,0,employee.joindate)*


*It is Showing the Following Error :*



*[DEPRECATED] By requiring 'spreadsheet/excel' you are loading a
Compatibility
             layer which provides a drop-in replacement for
Spreadsheet::Excel
             versions <= 0.3.5.1. This code will be removed in
Spreadsheet
             version 1.0.0*



*Can Anyone PLease help me...*
This topic is locked and can not be replied to.