diff options
Diffstat (limited to 'app/helpers/timelog_helper.rb')
-rw-r--r-- | app/helpers/timelog_helper.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index 178929161..01dcbb473 100644 --- a/app/helpers/timelog_helper.rb +++ b/app/helpers/timelog_helper.rb @@ -81,8 +81,7 @@ module TimelogHelper ic = Iconv.new(l(:general_csv_encoding), 'UTF-8') decimal_separator = l(:general_csv_decimal_separator) custom_fields = TimeEntryCustomField.find(:all) - export = StringIO.new - CSV::Writer.generate(export, l(:general_csv_separator)) do |csv| + export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv| # csv header fields headers = [l(:field_spent_on), l(:field_user), @@ -115,7 +114,6 @@ module TimelogHelper csv << fields.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end } end end - export.rewind export end @@ -124,8 +122,7 @@ module TimelogHelper end def report_to_csv(criterias, periods, hours) - export = StringIO.new - CSV::Writer.generate(export, l(:general_csv_separator)) do |csv| + export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv| # Column headers headers = criterias.collect {|criteria| l(@available_criterias[criteria][:label]) } headers += periods @@ -144,7 +141,6 @@ module TimelogHelper row << "%.2f" %total csv << row end - export.rewind export end |