سؤال

I am trying to work on a spreadsheet for an in-house application. So far it is going pretty well. While, probably not the worst thing that can happen, since it can be fixed by clicking on the cell and pressing enter, it is annoying to me.

I am using the AXLSX gem on Ruby-On-Rails 3.2.13.

My format code is:

date_cell = s.add_style :format_code=>"mm/dd/yy", :bg_color=>"ffffcc"

My cell has, in the array, the formula:

"=E#{row.to_s}+G#{row.to_s}*30"

I've tried adding formula_values, but with no avail:

 :formula_values=>["05/01/12","05/01/12",...] # all the same

I've done the following:

  • Checked to make sure the format is being applied to that specific cell
  • Made sure the formula_values were filled by output to the log file

I'm not sure if I am missing a step or what. Help would be appreciated.

هل كانت مفيدة؟

المحلول

Without wrapping, when a cell is not wide enough for its content it usually spills over (if text) or fills with hash signs (if numeric) – or widens itself to suit. However it seems that if the column width has already been adjusted the automatic widening does not repeat. Anyway, it was column width that was the problem and I understand this was solved with sheet.column_widths *args - so all’s well than ends well.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top