I have a requirement to export an Excel template, with just a header row containing the column names, and each of the columns set to the appropriate data type for the entire spreadsheet. Is this possible to do using the axlsx gem?
I tried this as an example, but it just formats the one 'Count' cell with the number format, not all cells in the column.
wb.styles do |s|
num_format = s.add_style(:format_code => "#,###")
wb.add_worksheet(:name => "Formatting Data") do |sheet|
#add header row for template
sheet.add_row ["Product", "Count"]
#format column
sheet.col_style(1, num_format)
end
end