birt-api 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d870b284d3729375d13a7802adb38eb1e5a9895
4
- data.tar.gz: 76bffd051b86ee002413ffe23f1c32a676badd76
3
+ metadata.gz: e95982cca8b7f46679a7bc3ee8fc56a406670b76
4
+ data.tar.gz: 3ca06d99432296bc2102ee4967149d8579bed9b4
5
5
  SHA512:
6
- metadata.gz: 7ee7a62728c8015dab4658d0795677f5de99b32c2faeee1d056ddae4271f6ee49c1922d758ad702d946c5cec3b6d31dc2c9c290256db81917af40ff2c8d48a4a
7
- data.tar.gz: 3d3653fa5e09021fba78ed5f95ed3c62d6f2d2e1a35f2efd06762871d55ee0b7ca1c016506a25c3f1e4534b3064a6b8813847cbb78012f301f32bd5042b0108d
6
+ metadata.gz: 038a5ac628696a277d67cc0be45c8ae2f2da7064700138737a4b547a2f5b8cfa8a567906d91e2c37521a64c08ba96b5d8d57843c4bb7d10bb6330107f7610628
7
+ data.tar.gz: 96d5ba1e6c148aded4d34f4c24914c711b11edbe424d19fa52d2335997778d602fec931644198637941bf0e6bee0a661e0326ed42af963892f827122b11c8c28
@@ -1,6 +1,6 @@
1
1
  module Birt::ApiHelper
2
2
 
3
- def parse_table_header(table_header)
3
+ def parse_table_header(table_header, table=nil)
4
4
  header = []
5
5
  table_header.rows.each_with_index { |row, index|
6
6
  header << []
@@ -8,7 +8,21 @@ module Birt::ApiHelper
8
8
  header[index] << row_cell.cell_labels[0].text_properties[0].text
9
9
  }
10
10
  }
11
-
12
11
  header
13
12
  end
13
+
14
+ def parse_table_detail(table_detail, table)
15
+ detail = []
16
+ table_detail.rows.each_with_index { |row|
17
+ row.row_cells.each { |row_cell|
18
+ data = row_cell.cell_datas[0].properties[0]
19
+ data_set_result = table.data_set.data_set_result
20
+ data_set_result.columns[data_set_result.column_headers.index(data.text)].each_with_index { |d, row_i|
21
+ detail << [] unless detail[row_i]
22
+ detail[row_i] << d
23
+ }
24
+ }
25
+ }
26
+ detail
27
+ end
14
28
  end
@@ -2,5 +2,6 @@ json.rpt_design do
2
2
  json.tables @rpt_design.reports[:tables].values do |table|
3
3
  json.id table.id
4
4
  json.header parse_table_header(table.header)
5
+ json.detail parse_table_detail(table.detail,table)
5
6
  end
6
7
  end
@@ -1,5 +1,5 @@
1
1
  module Birt
2
2
  module Api
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birt-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saxer