Created
April 26, 2012 19:03
-
-
Save pullmonkey/2502027 to your computer and use it in GitHub Desktop.
Spreadsheet gem add header to every page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Spreadsheet | |
| module Excel | |
| module Writer | |
| class Worksheet | |
| alias_method :write_from_scratch_without_header, :write_from_scratch | |
| def write_header | |
| write_op opcode(:header), [@worksheet.header.bytesize, 0].pack("vC"), @worksheet.header | |
| end | |
| def write_from_scratch | |
| write_header | |
| write_from_scratch_without_header | |
| end | |
| end | |
| end | |
| end | |
| class Worksheet | |
| attr_accessor :header | |
| def add_header(str) | |
| @header = str | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment