# Hi Everyone

**URL:** <https://www.ruby-forum.com/t/hi-everyone/152224>\
**Category:** Rails\
**Created:** [October 31, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/hi-everyone/152224 "2008-10-31T14:06:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [October 31, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/hi-everyone/152224/1 "2008-10-31T14:06:05Z")

</div>

_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…_
