Module: Birt::ApiHelper

Defined in:
lib/app/helpers/birt/api_helper.rb

Instance Method Summary collapse

Instance Method Details

#parse_table_detail(table_detail, table) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/app/helpers/birt/api_helper.rb', line 15

def parse_table_detail(table_detail, table)
  detail = []
  table_detail.rows.each_with_index { |row|
    row.row_cells.each { |row_cell|
      data = row_cell.cell_datas[0].properties[0]
      data_set_result = table.data_set.data_set_result
      data_set_result.columns[data_set_result.column_headers.index(data.text)].each_with_index { |d, row_i|
        detail << [] unless detail[row_i]
        detail[row_i] << d
      }
    }
  }
  detail
end

#parse_table_header(table_header, table = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/app/helpers/birt/api_helper.rb', line 4

def parse_table_header(table_header, table=nil)
  header = []
  table_header.rows.each_with_index { |row, index|
    header << []
    row.row_cells.each { |row_cell|
      header[index] << row_cell.cell_labels[0].text_properties[0].text
    }
  }
  header
end