Rohit Bhore
Rohit Bhore

Reputation: 41

Axlsx_Rails : How to add value into row

Here in below example, I want to add each array elements as separate column value between 'value1' & 'value2'. Anyone have an idea about it?

wb = xlsx_package.workbook
wb.styles do |style|
  wb.add_worksheet(name: "Result") do |sheet|
    sheet.add_row ['Value1', 'Value2']
  end
end

Upvotes: 1

Views: 1169

Answers (1)

Antima Gupta
Antima Gupta

Reputation: 381

Use add_cell

add_cell(value = '', options = {}) ⇒ Cell This adds a single cell to the row based on the data provided and updates the worksheet's autofit data.

http://www.rubydoc.info/github/randym/axlsx/Axlsx/Row

Upvotes: 2

Related Questions