I am pretty new to ruby and trying to format all columns generated to text for the excel file. I have got a function as below
def writeXlsx(columnNames, templateName)
@xlsx = Axlsx::Package.new # create xlsx doc
@xlsx.use_autowidth = true
@xlsxSheet = @xlsx.workbook.add_worksheet(:name => templateName)
@unlocked = @xlsx.workbook.styles.add_style(:locked => false)
@xlsxSheet.col_style(0,@unlocked)
@xlsxSheet.add_row columnNames, :types => string
@xlsx.serialize(File.join(@outputFolder, "#{templateName}.xlsx"))
end
this errors out saying col_style undefined method. Can you please tell me what I am doing wrong? -ela
Axlsx does not seem to have this option. I figured out to do it using write_xlsx gem.