Skip to content

Commit

Permalink
method header line
Browse files Browse the repository at this point in the history
  • Loading branch information
xuling1979 committed Jan 23, 2025
1 parent 994f770 commit dfade7a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/datum/ext/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def export_required_indexes
[]
end

def header_line
template.header_line
end

def set_headers
format = workbook.add_format(
fg_color: '#bbbbbb',
Expand All @@ -66,7 +70,7 @@ def set_headers
)

_format = format
items = template.template_items.where(position: 1..template.header_line)
items = template.template_items.where(position: 1..header_line)
items.each_with_index do |item, row|
item.fields.adjoin_repeated.each do |col, value|
if col.is_a?(Array)
Expand Down Expand Up @@ -141,7 +145,7 @@ def set_note
if index
col_str = ColName.instance.col_str(index)
worksheet.write_comment(
"#{col_str}#{template.header_line}",
"#{col_str}#{header_line}",
"#{note.fields.join("\n")}",
width: 250,
height: 180
Expand Down

0 comments on commit dfade7a

Please sign in to comment.