Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Hannes Wyss
RE: LOTS of warnings from sample [ reply ]  
2009-02-13 14:49
Fixed in 0.6.3.1

best,
Hannes

By: Eric Peterson
LOTS of warnings from sample [ reply ]  
2009-02-09 20:03
Using your sample code and the require settings for my app, I get the listing of warnings below. Also, Row 0 has an exceeding large row height. Opening in MS Excel 2007 it opens with a height of 400+. Which is odd as it is set to 18 below.



#!C:\ruby\bin\ruby -w
# ========== ========== ========== ========== ========== ========== ==========
#
ENV['ORACLE_HOME'] = 'C:\\app\\product\\11.1.0\\client_1'
ENV['ORACLE_SID'] = 'xxxxxxx'
ENV['PATH'] = "#{ENV['ORACLE_HOME']};#{ENV['ORACLE_HOME']}\\bin;#{ENV['PATH']}"

require 'daily_h' # app functions
require 'getoptlong'
require 'logger'
require 'oci8'
require 'spreadsheet'


Spreadsheet.client_encoding = 'UTF-8'

book = Spreadsheet::Workbook.new

sheet1 = book.create_worksheet

sheet2 = book.create_worksheet :name => 'My Second Worksheet'
sheet1.name = 'My First Worksheet'

sheet1.row(0).concat %w{Name Country Acknowlegement}
sheet1[1,0] = 'Japan'
row = sheet1.row(1)
row.push 'Creator of Ruby'
row.unshift 'Yukihiro Matsumoto'
sheet1.row(2).replace [ 'Daniel J. Berger', 'U.S.A.',
'Author of original code for Spreadsheet::Excel' ]
sheet1.row(3).push 'Charles Lowe', 'Author of the ruby-ole Library'
sheet1.row(3).insert 1, 'Unknown'
sheet1.update_row 4, 'Hannes Wyss', 'Switzerland', 'Author'

sheet1.row(0).height = 18

format = Spreadsheet::Format.new :color => :blue,
:weight => :bold,
:size => 18
sheet1.row(0).default_format = format

bold = Spreadsheet::Format.new :weight => :bold
4.times do |x| sheet1.row(x + 1).set_format(0, bold) end

book.write 'excel-file.xls'



C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/workbook.rb:75: warning: useless use of a literal in void context
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/excel/reader.rb:186: warning: `*' interpreted as argument prefix
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/excel/reader.rb:720: warning: statement not reached
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/worksheet.rb:144: warning: useless use of a literal in void context
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/datatypes.rb:76: warning: instance variable @size not initialized
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/datatypes.rb:76: warning: instance variable @weight not initialized
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/datatypes.rb:27: warning: instance variable @italic not initialized
C:/Ruby/lib/ruby/gems/1.8/gems/spreadsheet-0.6.3/lib/spreadsheet/datatypes.rb:27: warning: instance variable @strikeout not initialized

and continues on for many more warnings.