workbook = xlsx_package.workbook
styles = workbook.styles

border_style = styles.add_style(
  border: { style: :thin, color: "000000", edges: [ :top, :bottom, :left, :right ] },
  alignment: { wrap_text: true, vertical: :top },
  sz: 10,
  name: "Arial"
)

header_style = styles.add_style(
  b: true,
  border: { style: :thin, color: "000000", edges: [ :top, :bottom, :left, :right ] },
  alignment: { wrap_text: true, vertical: :top, horizontal: :center },
  bg_color: "EEEEEE",
  sz: 10,
  name: "Arial"
)

workbook.add_worksheet(name: "Entries") do |sheet|
  sheet.add_row [
    "Finnish", "English", "Swedish", "Norwegian", "Russian", "German"
  ], style: header_style

  @entries.find_each do |entry|
    sheet.add_row [
      entry.fi,
      entry.en,
      entry.sv,
      entry.no,
      entry.ru,
      entry.de
    ], style: border_style
  end

  sheet.column_widths 21.4, 21.4, 21.4, 21.4, 21.4, 21.4
  sheet.auto_filter = sheet.dimension.sqref
end
