M
Michael Schmarck
Hello.
I'm using spreadsheet-excel-0.3.5.1 on Windows XP with Excel 2000 and
ruby 1.8.6. I'm trying to merge some cells, but don't succeed in doing
so :/
Here's my code:
require 'spreadsheet/excel'
EXCEL_REPORT_FILE = "Report.xls"
workbook = Spreadsheet::Excel.new(EXCEL_REPORT_FILE)
worksheet = workbook.add_worksheet
format_merged = workbook.add_format
align => "merge")
worksheet.write(0, 0, ["Host", "Date", "Headertext", "", "", "", "Something else"])
workbook.close
I would have expected (or at least that's what I wanted to achieve...),
that the "Headertext" spans the columns C..F in row 1. But this does
not happen. What happens is, that "Headertext" is only visible in cell
C1. I uploaded the generated Excel XLS file to
<http://michael-schmarck.share.s3.amazonaws.com/Report.xls>.
Obviously, I'm doing something wrong here, as the cells don't merge.
How would I do that correctly?
Thanks a lot,
Michael
I'm using spreadsheet-excel-0.3.5.1 on Windows XP with Excel 2000 and
ruby 1.8.6. I'm trying to merge some cells, but don't succeed in doing
so :/
Here's my code:
require 'spreadsheet/excel'
EXCEL_REPORT_FILE = "Report.xls"
workbook = Spreadsheet::Excel.new(EXCEL_REPORT_FILE)
worksheet = workbook.add_worksheet
format_merged = workbook.add_format
worksheet.write(0, 0, ["Host", "Date", "Headertext", "", "", "", "Something else"])
workbook.close
I would have expected (or at least that's what I wanted to achieve...),
that the "Headertext" spans the columns C..F in row 1. But this does
not happen. What happens is, that "Headertext" is only visible in cell
C1. I uploaded the generated Excel XLS file to
<http://michael-schmarck.share.s3.amazonaws.com/Report.xls>.
Obviously, I'm doing something wrong here, as the cells don't merge.
How would I do that correctly?
Thanks a lot,
Michael