Sha256: 8cc43efc6801882075a3f3acad22b633a8295c6802c9e01123403a34de65965d

Contents?: true

Size: 620 Bytes

Versions: 1

Compression:

Stored size: 620 Bytes

Contents

require_relative '../lib/fast_excel'
require 'pp'
require 'looksee'

workbook = FastExcel.open("example_formula.xlsx", constant_memory: false)

worksheet = workbook.add_worksheet

worksheet.write_row(0, ["Item", "Weight"])
worksheet.write_row(1, ["Laptop", 1.37])
worksheet.write_row(2, ["Phone", 0.138])
worksheet.write_row(3, ["Mouse", 0.099])
worksheet.write_row(4, ["Speaker", 2.5])
worksheet.write_row(5, ["Camera", 0.383])
worksheet.write_row(6, ["Total", FastExcel::Formula.new("SUM(B2:B6)")], workbook.bold_cell_format)

bold = workbook.bold_cell_format

workbook.close
puts "Saved to file example_formula.xlsx"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fast_excel-0.2.1 examples/example_formula.rb