# encoding: utf-8 wb = xlsx_package.workbook @data.each_with_index do |role,idx| data = role["data"] wb.add_worksheet(name: role["name"] + "-" + idx.to_s) do |sheet| heading = sheet.styles.add_style(:b => true, :locked => true) row = [t("personal_patent.member_profile")] @site_in_use_locales.each do |locale| row << t("personal_patent.patent_title") + " - " + t(locale.to_s) end @site_in_use_locales.each do |locale| row << t("personal_patent.patent_country") + " - " + t(locale.to_s) end @site_in_use_locales.each do |locale| row << t("personal_patent.authors") + " - " + t(locale.to_s) end row << t("personal_patent.year") row << t("personal_patent.publication_date") row << t("personal_patent.expiration_date") row << t("personal_patent.patent_type.title") sheet.add_row row, :style => heading data.each do |patent| row = [(patent.member_profile.name rescue "")] @site_in_use_locales.each do |locale| row << patent.patent_title_translations[locale.to_s] end @site_in_use_locales.each do |locale| row << patent.patent_country_translations[locale.to_s] end @site_in_use_locales.each do |locale| row << patent.authors_translations[locale.to_s] end row << patent.display_field("year",true) row << patent.display_field("publication_date",true) row << patent.display_field("expiration_date",true) row << (patent.patent_type.title rescue "") sheet.add_row row end end end