Added data to excel sheet

This commit is contained in:
Godwin
2016-08-09 22:03:11 -07:00
parent 2c5351389d
commit 8ffb852b4d
3 changed files with 79 additions and 16 deletions
+5 -4
View File
@@ -8,13 +8,14 @@
- @excel_data[:data].each do |row|
%tr
- @excel_data[:columns].each do |column|
%td{class: (@excel_data[:column_types].present? && @excel_data[:column_types][column].present?) ? @excel_data[:column_types][column].to_s : nil}
- if row[column].present?
=_!row[column]
%td{class: (@excel_data[:column_types].present? && @excel_data[:column_types][column].present?) ? @excel_data[:column_types][column] : nil}=(row[column].present? ? (_!row[column]) : '')
- format_xls 'table' do
- workbook use_autowidth: true
- format bg_color: '333333'
- format 'td', font_name: 'Calibri', bg_color: 'ffffff', fg_color: '333333'
- format 'th', font_name: 'Calibri', b: true, bg_color: '333333', fg_color: 'ffffff'
- format 'td.date', num_fmt: 22, font_name: 'Courier New', sz: 10
- format 'td.date', num_fmt: 22, font_name: 'Courier New', sz: 10, bg_color: 'ffffff', fg_color: '333333'
- format 'td.date.day', num_fmt: 14, font_name: 'Courier New', sz: 10, bg_color: 'ffffff', fg_color: '333333'
- format 'td.money', num_fmt: 2, font_name: 'Courier New', sz: 10, bg_color: 'ffffff', fg_color: '333333'
- format 'td.bold', font_name: 'Calibri', bg_color: 'ffffff', fg_color: '333333', b: true