Prev | Current Page 91 | Next

David Berube

"Practical Reporting with Ruby and Rails"

If it really irritates you,
you could create an object that simulates a stream object fairly easily, which would let the object keep track
of this for you. Whether this is helpful depends on your application, and such an approach would not necessarily
help applications with a complicated layout.
CHAPTER 4 n CREATING REPORTS ON THE DESKTOP 58
After that, you write a brief header describing your data for each player. This call is
interesting, since it passes an array to the write method of your worksheet object. This
array is expanded into the cells to the right of the cell, so these two blocks of code are
the same:
# This:
worksheet.write(current_row, 0, ['Game', 'Wins', 'Losses'], header_format)
# ... Is just like this:
worksheet.write(current_row, 0, 'Game', header_format)
worksheet.write(current_row, 1, 'Wins', header_format)
worksheet.write(current_row, 2, 'Losses', header_format)
Additionally, the write method can accept a format, just like the format_column and
format_row methods. This can be used to highlight just one cell of a row or column.


Pages:
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
petrozawodzkich.waw.pl leczenie alkoholizmu Meble Gabi aragorn.binto.pl Prywatny Ośrodek Terapii uzależnień