Sha256: db638ad10d1b165568449f304f3c66595b49f5d4683dc63392a295d4ff0c3e55
Contents?: true
Size: 756 Bytes
Versions: 8
Compression:
Stored size: 756 Bytes
Contents
require 'writeexcel' module Mondrian::REST::Formatters module XLS def self.call(result, env) params = env['api.endpoint'].params add_parents = params['parents'] debug = params['debug'] sparse = params['sparse'] properties = params['properties'] || [] out = StringIO.new book = WriteExcel.new(out) sheet = book.add_worksheet Mondrian::REST::Formatters .tidy(result, add_parents: add_parents, debug: debug, sparse: sparse, properties: properties) .each_with_index do |row, i| row.each_with_index { |cell, j| sheet.write(i, j, cell) } end book.close out.string end end end
Version data entries
8 entries across 8 versions & 1 rubygems