Prev | Current Page 89 | Next

David Berube

"Practical Reporting with Ruby and Rails"

(This will likely be fixed
in a future release; as of this writing, the current version of the spreadsheet gem is
0.3.5.1.) However, by calling format_column with both a width and a dummy format, you
CHAPTER 4 n CREATING REPORTS ON THE DESKTOP 57
can achieve the desired effect of widening the column without changing the display
format.
Next, the script begins to write information to the spreadsheet. It begins with a
header stating the title of the spreadsheet:
current_row=0
worksheet.write(current_row, 0, 'Player Win/Loss Report', page_header_format)
The first line initializes a variable, current_row, which will store the current row in
the spreadsheet. The second line uses the write method of the worksheet object to write
???Player Win/Loss Report??? using the page_header_format format, which has a large, bold
font. The worksheet.write method takes a row number, a column number, a value, and an
optional format. (Note that the code uses the current_row variable only for consistency
with later code, since it will always equal zero at this point.


Pages:
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
Projekty domów K10 teksty piosenek poker online William Hill Poker