diff --git a/app/controllers/olympiamanagements_controller.rb b/app/controllers/olympiamanagements_controller.rb index d4ef069..6b28e45 100644 --- a/app/controllers/olympiamanagements_controller.rb +++ b/app/controllers/olympiamanagements_controller.rb @@ -319,8 +319,8 @@ class OlympiamanagementsController < ApplicationController f.write render_to_string( :handlers=> [:axlsx], :formats=> [:xlsx] ,:partial=> 'school_code.xlsx',:locals=> {:@OlympiaSchoolDataFields=>@OlympiaSchoolDataFields} ) end end - tmp_filename_data = File.read(dir_path +@filename) - send_data(tmp_filename_data, type: 'application/xlsx', disposition: 'attachment', filename: "#{Time.now.year}#{Time.now.month}#{Time.now.day}_download_school_code.xlsx") + system("soffice --headless --convert-to ods #{dir_path +@filename} -outdir #{dir_path}") + send_file(dir_path +@filename[0..@filename.rindex('.')]+'ods') end def render_contents_in_index_page(contents=@breadcumb) doc = Nokogiri::HTML(render_final_page("page",Page.where(:layout=>"olympia_managements_index").first,true), nil, "UTF-8")