You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: reports_controller.rb
    path of file: ./repos/reports_kit/lib/reports_kit
    
    the code of the file until where you have to start completion: require 'csv'
requi
    
    def xls_string
      spreadsheet = Spreadsheet::Workbook.new
      sheet = spreadsheet.create_worksheet
      report_data[:table_data].each_with_index do |row, index|
        sheet.update_row(index, *row)
      end
      io = StringIO.new
      spreadsheet.write(io)
      io.string
    end