randym / axlsx

xlsx generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx excels at helping you generate beautiful Office Open XML Spreadsheet documents without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
MIT License
2.62k stars 697 forks source link

Formula are not calculating values #600

Closed zeeshangulzar closed 6 years ago

zeeshangulzar commented 6 years ago

I have run the following chunk of code from example provided, but cells with formulas are blank

Example https://gist.github.com/randym/2371912

require 'axlsx'
  p = Axlsx::Package.new
  wb = p.workbook
  wb.add_worksheet(:name => "Using Formulas") do |sheet|
    sheet.add_row ['col 1', 'col 2', 'col 3', 'col 4']
    sheet.add_row [1, 2, 3, "=SUM(A2:C2)"]
  end

Please if you can guide me in right direction. data = p.serialize("example.xlsx")

zeeshangulzar commented 6 years ago

It is not displayed in preview. But it is displayed at google sheets. Not related to gem.

Thanks for such a wonderful gem.