Sha256: d8744920456595d63244827eb82231125b54e7eeb75568374c7a9bf17e884a9c

Contents?: true

Size: 589 Bytes

Versions: 5

Compression:

Stored size: 589 Bytes

Contents

require_relative '../lib/fast_excel'

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

5 entries across 5 versions & 2 rubygems

Version Path
fast_excel-0.2.6 examples/example_formula.rb
fast_excel-0.2.5 examples/example_formula.rb
fast_excel-0.2.3 examples/example_formula.rb
fast_excel-0.2.2 examples/example_formula.rb
kmadej_fast_excel_fork-0.2.2 examples/example_formula.rb