zdavatz / spreadsheet

The Ruby Spreadsheet by ywesee GmbH
http://spreadsheet.ch
GNU General Public License v3.0
1.13k stars 240 forks source link

unable to add bottom border to merged cells #184

Closed parmindersingh1 closed 8 years ago

parmindersingh1 commented 8 years ago

I am not able to set border (bottom ) of merged rows and cells, only bottom border is not displaying

format is border_format = Spreadsheet::Format.new :border=>:thin, :size => 8

Here is code,

      data.merge_cells(term_in+3, 1+report_column_index, term_in+6,terms.count+1+report_column_index)
       4.times do |r|
        (terms.count+1).times do |c|
          data.row(term_in+3+r).set_format(1+report_column_index+c, border_format)
        end
      end
      data[term_in+3,1+report_column_index] = student_term_remark.remarks 
zdavatz commented 8 years ago

Please post the full test code and sample file here. Also what OS and Ruby Version are you running?

parmindersingh1 commented 8 years ago

i am using ubuntu 16.04, Now i fixed the problem by adding empty string to cell here is code

data.merge_cells(term_in+3, 1+report_column_index, term_in+6,terms.count+1+report_column_index)
   4.times do |r|
    (terms.count+1).times do |c|
      data.row(term_in+3+r).set_format(1+report_column_index+c, border_format)
     # added this line
      data[term_in+3+r,1+report_column_index+c] = ""
    end
  end
  data[term_in+3,1+report_column_index] = student_term_remark.remarks 
zdavatz commented 8 years ago

Ok, cool thanks for sharing this with us!