birt-core 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2887c763abd64e6571cedad3123c5d28936b726d
4
- data.tar.gz: 7991f9d072c54f5c1325a122903797d88cc78fe1
3
+ metadata.gz: a544bcc40ba2a57eed0d943ab9d06ac20b240dd6
4
+ data.tar.gz: 8cd5a6518a4e0f16f36e0625dfc90429664e9268
5
5
  SHA512:
6
- metadata.gz: eb563fa7c8ddb15f0455652330d12f852ebbea187c8b97df0b46e64d72d6aa65a21c9da19ab61405289d1e5bc424dd10c804edd452f2d69045b747e4de60a678
7
- data.tar.gz: db96799edcb5d94e9ff134f585ee2d5877fa707479df94b4353571dc6beeca18d213323936553e21874d17053b8000ad113a3b558cc28464242c151faabb23a5
6
+ metadata.gz: 0f2228a46334777181b79c6ec36ccb6a720d1ed80e3e3865e7b6035db692f993a7ad3a4d089332a1c8e1fe313707be718801c36dc940a7c06101082704e28509
7
+ data.tar.gz: 02296dda0057b373aeec3a9af7989ca7d273bdd68a11e6b42a67cb551edb84183f32ba73069d1b6b9ef37f4c8c7c324d5213c873c99576e25dc6b7d787d2a8a7
@@ -2,20 +2,42 @@ class Birt::Core::RptDesign
2
2
 
3
3
  #design文件路径
4
4
  attr_accessor :rpt_design_path
5
+
6
+ #报表的名字
7
+ attr_accessor :display_name
8
+
9
+ #数据源
5
10
  attr_accessor :data_sources
11
+
12
+ #数据集
6
13
  attr_accessor :data_sets
14
+
15
+ #图表
7
16
  attr_accessor :reports
8
17
 
18
+
9
19
  def initialize(rpt_design_path)
10
20
  self.rpt_design_path = rpt_design_path
11
21
  @data_sources, @data_sets = {}, {}
12
22
  @reports = {tables: {}}
13
23
  end
14
24
 
25
+ def display_name(root=nil)
26
+ unless @display_name
27
+ _root = root|| REXML::Document.new(File.read(self.rpt_design_path)).root
28
+ names = _root.get_elements("/report/text-property[@name='displayName']")
29
+ @display_name = names[0].text if names
30
+ end
31
+ @display_name
32
+ end
33
+
15
34
  #解析文件
16
35
  def parse_rpt
17
36
  _root = REXML::Document.new(File.read(self.rpt_design_path)).root
18
37
 
38
+ #报表名称
39
+ @display_name = self.display_name(_root)
40
+
19
41
  #数据源
20
42
  _root.each_element(xpath = '/report/data-sources/oda-data-source') do |item|
21
43
  p @data_sources[item.attribute(:name).value] = Birt::Core::DataSource.new(item)
@@ -1,5 +1,5 @@
1
1
  module Birt
2
2
  module Core
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birt-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saxer