beardley 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/lib/beardley/report.rb +6 -1
- data/lib/beardley/version.rb +1 -1
- data/lib/beardley.rb +11 -1
- data/test/test_print.rb +4 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
beardley (0.
|
4
|
+
beardley (0.3.0)
|
5
5
|
beardley-barcode (>= 0.0.1)
|
6
6
|
beardley-core (>= 5.0.0)
|
7
7
|
beardley-groovy (>= 1.7.5)
|
@@ -14,7 +14,7 @@ GEM
|
|
14
14
|
beardley-core (5.0.0.0)
|
15
15
|
beardley-groovy (1.7.5.1)
|
16
16
|
colorize (0.5.8)
|
17
|
-
coveralls (0.6.
|
17
|
+
coveralls (0.6.5)
|
18
18
|
colorize
|
19
19
|
multi_json (~> 1.3)
|
20
20
|
rest-client
|
data/lib/beardley/report.rb
CHANGED
@@ -62,6 +62,11 @@ module Beardley
|
|
62
62
|
return to(:ods, *args)
|
63
63
|
end
|
64
64
|
|
65
|
+
# Export report to CSV with given datasource
|
66
|
+
def to_csv(*args)
|
67
|
+
return to(:csv, *args)
|
68
|
+
end
|
69
|
+
|
65
70
|
# Export report to DOCX with given datasource
|
66
71
|
def to_docx(*args)
|
67
72
|
return to(:docx, *args)
|
@@ -124,7 +129,7 @@ module Beardley
|
|
124
129
|
if datasource
|
125
130
|
input_source = InputSource.new
|
126
131
|
input_source.setCharacterStream(StringReader.new(datasource.to_s))
|
127
|
-
data_document = JRXmlUtils._invoke('parse', 'Lorg.xml.sax.InputSource;', input_source)
|
132
|
+
data_document = Beardley.with_warnings { JRXmlUtils._invoke('parse', 'Lorg.xml.sax.InputSource;', input_source) }
|
128
133
|
|
129
134
|
jasper_params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, data_document)
|
130
135
|
jasper_print = JasperFillManager.fillReport(@object_file.to_s, jasper_params)
|
data/lib/beardley/version.rb
CHANGED
data/lib/beardley.rb
CHANGED
@@ -34,6 +34,15 @@ module Beardley
|
|
34
34
|
|
35
35
|
class << self
|
36
36
|
attr_accessor :config
|
37
|
+
|
38
|
+
# Changes the level of verbosity
|
39
|
+
def with_warnings(flag = nil)
|
40
|
+
old_verbose, $VERBOSE = $VERBOSE, flag
|
41
|
+
yield
|
42
|
+
ensure
|
43
|
+
$VERBOSE = old_verbose
|
44
|
+
end
|
45
|
+
|
37
46
|
end
|
38
47
|
|
39
48
|
Rjb::load((["."] + Beardley::Core.classpath + Beardley::Groovy.classpath + Beardley::Barcode.classpath).join(File::PATH_SEPARATOR), ['-Djava.awt.headless=true','-Xms128M', '-Xmx256M'])
|
@@ -43,10 +52,11 @@ module Beardley
|
|
43
52
|
JRException = Rjb::import('net.sf.jasperreports.engine.JRException')
|
44
53
|
JRExporterParameter = Rjb::import('net.sf.jasperreports.engine.JRExporterParameter')
|
45
54
|
JRXmlUtils = Rjb::import('net.sf.jasperreports.engine.util.JRXmlUtils')
|
46
|
-
JRXPathQueryExecuterFactory = Rjb::import('net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory')
|
55
|
+
JRXPathQueryExecuterFactory = with_warnings { Rjb::import('net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory') }
|
47
56
|
JREmptyDataSource = Rjb::import('net.sf.jasperreports.engine.JREmptyDataSource')
|
48
57
|
JROdtExporter = Rjb::import('net.sf.jasperreports.engine.export.oasis.JROdtExporter')
|
49
58
|
JROdsExporter = Rjb::import('net.sf.jasperreports.engine.export.oasis.JROdsExporter')
|
59
|
+
JRCsvExporter = Rjb::import('net.sf.jasperreports.engine.export.JRCsvExporter')
|
50
60
|
JRDocxExporter = Rjb::import('net.sf.jasperreports.engine.export.ooxml.JRDocxExporter')
|
51
61
|
JRXlsxExporter = Rjb::import('net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter')
|
52
62
|
|
data/test/test_print.rb
CHANGED
@@ -11,6 +11,7 @@ class TestPrint < Test::Unit::TestCase
|
|
11
11
|
report.to_pdf
|
12
12
|
report.to_odt
|
13
13
|
report.to_ods
|
14
|
+
report.to_csv
|
14
15
|
report.to_docx
|
15
16
|
report.to_xlsx
|
16
17
|
end
|
@@ -24,6 +25,7 @@ class TestPrint < Test::Unit::TestCase
|
|
24
25
|
report.to_pdf
|
25
26
|
report.to_odt
|
26
27
|
report.to_ods
|
28
|
+
report.to_csv
|
27
29
|
report.to_docx
|
28
30
|
report.to_xlsx
|
29
31
|
end
|
@@ -39,6 +41,7 @@ class TestPrint < Test::Unit::TestCase
|
|
39
41
|
report.to_pdf(datasource)
|
40
42
|
report.to_odt(datasource)
|
41
43
|
report.to_ods(datasource)
|
44
|
+
report.to_csv(datasource)
|
42
45
|
report.to_docx(datasource)
|
43
46
|
report.to_xlsx(datasource)
|
44
47
|
end
|
@@ -52,6 +55,7 @@ class TestPrint < Test::Unit::TestCase
|
|
52
55
|
report.to_pdf
|
53
56
|
report.to_odt
|
54
57
|
report.to_ods
|
58
|
+
report.to_csv
|
55
59
|
report.to_docx
|
56
60
|
report.to_xlsx
|
57
61
|
end
|
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.4.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-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rjb
|