beardley 0.1.2 → 0.2.0
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.
- data/lib/beardley/report.rb +10 -0
- data/lib/beardley/version.rb +2 -2
- data/lib/beardley.rb +2 -0
- data/test/test_print.rb +9 -1
- metadata +2 -2
data/lib/beardley/report.rb
CHANGED
@@ -57,11 +57,21 @@ module Beardley
|
|
57
57
|
return to(:odt, *args)
|
58
58
|
end
|
59
59
|
|
60
|
+
# Export report to ODS with given datasource
|
61
|
+
def to_ods(*args)
|
62
|
+
return to(:ods, *args)
|
63
|
+
end
|
64
|
+
|
60
65
|
# Export report to DOCX with given datasource
|
61
66
|
def to_docx(*args)
|
62
67
|
return to(:docx, *args)
|
63
68
|
end
|
64
69
|
|
70
|
+
# Export report to XLSX with given datasource
|
71
|
+
def to_xlsx(*args)
|
72
|
+
return to(:xlsx, *args)
|
73
|
+
end
|
74
|
+
|
65
75
|
private
|
66
76
|
|
67
77
|
# Generic method to export to some format like ODT and DOCX
|
data/lib/beardley/version.rb
CHANGED
data/lib/beardley.rb
CHANGED
@@ -49,7 +49,9 @@ module Beardley
|
|
49
49
|
JRXPathQueryExecuterFactory = Rjb::import('net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory')
|
50
50
|
JREmptyDataSource = Rjb::import('net.sf.jasperreports.engine.JREmptyDataSource')
|
51
51
|
JROdtExporter = Rjb::import('net.sf.jasperreports.engine.export.oasis.JROdtExporter')
|
52
|
+
JROdsExporter = Rjb::import('net.sf.jasperreports.engine.export.oasis.JROdsExporter')
|
52
53
|
JRDocxExporter = Rjb::import('net.sf.jasperreports.engine.export.ooxml.JRDocxExporter')
|
54
|
+
JRXlsxExporter = Rjb::import('net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter')
|
53
55
|
|
54
56
|
JasperCompileManager = Rjb::import('net.sf.jasperreports.engine.JasperCompileManager')
|
55
57
|
JasperExportManager = Rjb::import('net.sf.jasperreports.engine.JasperExportManager')
|
data/test/test_print.rb
CHANGED
@@ -10,7 +10,9 @@ class TestPrint < Test::Unit::TestCase
|
|
10
10
|
assert_equal Pathname, report.object_file.class
|
11
11
|
report.to_pdf
|
12
12
|
report.to_odt
|
13
|
+
report.to_ods
|
13
14
|
report.to_docx
|
15
|
+
report.to_xlsx
|
14
16
|
end
|
15
17
|
|
16
18
|
def test_print_of_empty_report
|
@@ -21,7 +23,9 @@ class TestPrint < Test::Unit::TestCase
|
|
21
23
|
assert_equal Pathname, report.object_file.class
|
22
24
|
report.to_pdf
|
23
25
|
report.to_odt
|
26
|
+
report.to_ods
|
24
27
|
report.to_docx
|
28
|
+
report.to_xlsx
|
25
29
|
end
|
26
30
|
|
27
31
|
def test_print_of_empty_report_with_datasource
|
@@ -34,7 +38,9 @@ class TestPrint < Test::Unit::TestCase
|
|
34
38
|
<things><thing name="First">1</thing><thing name="Second">2</thing></things>'
|
35
39
|
report.to_pdf(datasource)
|
36
40
|
report.to_odt(datasource)
|
41
|
+
report.to_ods(datasource)
|
37
42
|
report.to_docx(datasource)
|
43
|
+
report.to_xlsx(datasource)
|
38
44
|
end
|
39
45
|
|
40
46
|
def test_print_of_barcode_report
|
@@ -45,7 +51,9 @@ class TestPrint < Test::Unit::TestCase
|
|
45
51
|
assert_equal Pathname, report.object_file.class
|
46
52
|
report.to_pdf
|
47
53
|
report.to_odt
|
48
|
-
report.
|
54
|
+
report.to_ods
|
55
|
+
report.to_docx
|
56
|
+
report.to_xlsx
|
49
57
|
end
|
50
58
|
|
51
59
|
# TODO Test parameters
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beardley
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rjb
|