jasper-rails 1.0.0 → 1.0.1
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/.gitignore +1 -0
- data/README.md +1 -9
- data/config.ru +7 -0
- data/jasper-rails.gemspec +3 -0
- data/lib/jasper-rails.rb +5 -4
- data/lib/jasper-rails/version.rb +1 -1
- data/spec/controllers/people_controller_spec.rb +69 -0
- data/spec/internal/app/controllers/people_controller.rb +20 -0
- data/spec/internal/app/models/person.rb +16 -0
- data/spec/internal/app/views/people/compile_time_error_report.jrxml +118 -0
- data/spec/internal/app/views/people/index.jrxml +118 -0
- data/spec/internal/app/views/people/runtime_error_report.jrxml +90 -0
- data/spec/internal/app/views/people/wood.jpg +0 -0
- data/spec/internal/config/routes.rb +8 -0
- data/spec/internal/log/.gitignore +1 -0
- data/spec/spec_helper.rb +11 -0
- metadata +107 -50
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
JasperReports/Rails integration using Rjb (Ruby Java Bridge)
|
4
4
|
|
5
|
-
For rspec integration, see: [jasper-rails-rspec](http://github.com/fortesinformatica/jasper-rails-rspec).
|
6
|
-
|
7
5
|
# News!
|
8
6
|
|
9
7
|
Updated to JasperReports 4.7.1
|
@@ -91,14 +89,8 @@ For a running example, just clone: [jasper-rails-demo](http://github.com/fortesi
|
|
91
89
|
## History
|
92
90
|
This project was first developed at Grupo Fortes in 2011 and we have been using it in several projects since then.
|
93
91
|
Pay attention that all the features it supports right now were based in those project's especific needs. Therefore you might find a lot of
|
94
|
-
JasperResports' features that are not yet supported.
|
92
|
+
JasperResports' features that are not yet supported.
|
95
93
|
|
96
|
-
## TODO
|
97
|
-
* Configuration
|
98
|
-
* Better error treatment
|
99
|
-
* More RSpec matchers
|
100
|
-
* SPECS!!!
|
101
|
-
|
102
94
|
## LICENSE
|
103
95
|
|
104
96
|
Copyright (C) 2012 Marlus Saraiva, Rodrigo Maia
|
data/config.ru
ADDED
data/jasper-rails.gemspec
CHANGED
data/lib/jasper-rails.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
require "jasper-rails/version"
|
24
24
|
require "rails"
|
25
25
|
require "rjb"
|
26
|
+
require "action_controller/metal/responder"
|
26
27
|
|
27
28
|
if Mime::Type.lookup_by_extension("pdf").nil?
|
28
29
|
Mime::Type.register "application/pdf", :pdf
|
@@ -91,12 +92,12 @@ module JasperRails
|
|
91
92
|
JasperExportManager._invoke('exportReportToPdf', 'Lnet.sf.jasperreports.engine.JasperPrint;', jasper_print)
|
92
93
|
rescue Exception=>e
|
93
94
|
if e.respond_to? 'printStackTrace'
|
94
|
-
|
95
|
+
::Rails.logger.error e.message
|
95
96
|
e.printStackTrace
|
96
97
|
else
|
97
|
-
|
98
|
-
puts e.backtrace
|
98
|
+
::Rails.logger.error e.message + "\n " + e.backtrace.join("\n ")
|
99
99
|
end
|
100
|
+
raise e
|
100
101
|
end
|
101
102
|
end
|
102
103
|
end
|
@@ -104,7 +105,7 @@ module JasperRails
|
|
104
105
|
|
105
106
|
class ActionController::Responder
|
106
107
|
def to_pdf
|
107
|
-
jasper_file = "app/views/#{controller.controller_path}/#{controller.action_name}.jasper"
|
108
|
+
jasper_file = "#{Rails.root.to_s}/app/views/#{controller.controller_path}/#{controller.action_name}.jasper"
|
108
109
|
|
109
110
|
params = {}
|
110
111
|
controller.instance_variables.each do |v|
|
data/lib/jasper-rails/version.rb
CHANGED
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PeopleController do
|
4
|
+
|
5
|
+
describe "GET index" do
|
6
|
+
before do
|
7
|
+
Person.stub(:all).and_return([
|
8
|
+
Person.new(:name=>'john' , :email=>'lennon@beatles.com'),
|
9
|
+
Person.new(:name=>'george', :email=>'harrison@beatles.com')
|
10
|
+
])
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should respond success" do
|
14
|
+
get :index, :format => :pdf
|
15
|
+
|
16
|
+
response.should be_success
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should not contain nulls" do
|
20
|
+
get :index, :format => :pdf
|
21
|
+
|
22
|
+
response.should_not contain("null")
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should show all fields in the report" do
|
26
|
+
get :index, :format => :pdf
|
27
|
+
|
28
|
+
response.should contain("john")
|
29
|
+
response.should contain("lennon@beatles.com")
|
30
|
+
response.should contain("george")
|
31
|
+
response.should contain("harrison@beatles.com")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should clip the text if it's larger than the Text Field" do
|
35
|
+
Person.stub(:all).and_return([
|
36
|
+
Person.new(:name=>'jonh' , :email=>'a_very_long_text_that_is_larger_than_the_text_field_in_the_report')
|
37
|
+
])
|
38
|
+
|
39
|
+
get :index, :format => :pdf
|
40
|
+
|
41
|
+
response.should_not contain("a_very_long_text_that_is_larger_than_the_text_field_in_the_report")
|
42
|
+
response.should contain("a_very_long_text_that_is_larger_than_the_text_field_in_the_")
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should show the parameters defined in the controller" do
|
46
|
+
get :index, :format => :pdf
|
47
|
+
|
48
|
+
response.should contain("I'm a parameter. I was defined in the controller")
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "GET compile_time_error_report" do
|
54
|
+
|
55
|
+
it "should raise a RuntimeError if the report's design is not valid" do
|
56
|
+
expect { get :compile_time_error_report, :format => :pdf }.to raise_error(RuntimeError, /Report design not valid/)
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
describe "GET runtime_error_report" do
|
62
|
+
|
63
|
+
it "should raise a RuntimeError if the report could not be filled due to a runtime error" do
|
64
|
+
expect { get :runtime_error_report, :format => :pdf }.to raise_error(RuntimeError)
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class PeopleController < ActionController::Base
|
2
|
+
respond_to :xml, :pdf
|
3
|
+
|
4
|
+
def index
|
5
|
+
@people = Person.all
|
6
|
+
|
7
|
+
@parameter_defined_in_the_controller = "I'm a parameter. I was defined in the controller"
|
8
|
+
|
9
|
+
respond_with @people
|
10
|
+
end
|
11
|
+
|
12
|
+
def compile_time_error_report
|
13
|
+
respond_with []
|
14
|
+
end
|
15
|
+
|
16
|
+
def runtime_error_report
|
17
|
+
respond_with []
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Person
|
2
|
+
extend ActiveModel::Naming
|
3
|
+
include ActiveModel::Serializers::Xml
|
4
|
+
|
5
|
+
attr_accessor :name, :email
|
6
|
+
|
7
|
+
def initialize(hash)
|
8
|
+
hash.each do |key, value|
|
9
|
+
instance_variable_set("@#{key}", value)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def attributes
|
14
|
+
instance_values
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="index" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="311ea5a2-cc66-43bf-9af3-b2e0a552b1de">
|
3
|
+
<property name="ireport.zoom" value="1.0"/>
|
4
|
+
<property name="ireport.x" value="0"/>
|
5
|
+
<property name="ireport.y" value="0"/>
|
6
|
+
<style name="Title" forecolor="#FFFFFF" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
|
7
|
+
<style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="18"/>
|
8
|
+
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
|
9
|
+
<style name="Detail" fontName="Arial" fontSize="12"/>
|
10
|
+
<parameter name="parameter_defined_in_the_controller" class="java.lang.String"/>
|
11
|
+
<queryString language="xPath">
|
12
|
+
<![CDATA[/people/person]]>
|
13
|
+
</queryString>
|
14
|
+
<field name="name" class="java.lang.String">
|
15
|
+
<fieldDescription><![CDATA[name]]></fieldDescription>
|
16
|
+
</field>
|
17
|
+
<field name="email" class="java.lang.String">
|
18
|
+
<fieldDescription><![CDATA[email]]></fieldDescription>
|
19
|
+
</field>
|
20
|
+
<background>
|
21
|
+
<band splitType="Stretch"/>
|
22
|
+
</background>
|
23
|
+
<title>
|
24
|
+
<band height="70" splitType="Stretch">
|
25
|
+
<image>
|
26
|
+
<reportElement uuid="0b15b501-e65d-4f8b-b890-759a6d279efe" x="-20" y="0" width="595" height="64"/>
|
27
|
+
<imageExpression><![CDATA["wood.jpg"]]></imageExpression>
|
28
|
+
</image>
|
29
|
+
<staticText>
|
30
|
+
<reportElement uuid="dfeee47e-d32e-4525-a708-7cc3d6ec3f91" style="Title" x="0" y="5" width="263" height="33"/>
|
31
|
+
<textElement verticalAlignment="Middle"/>
|
32
|
+
<text><![CDATA[jasper-rails]]></text>
|
33
|
+
</staticText>
|
34
|
+
<textField>
|
35
|
+
<reportElement uuid="91699025-171b-40b4-ae45-eb9cdca69b2b" x="97" y="38" width="358" height="20" forecolor="#FFFFFF"/>
|
36
|
+
<textElement>
|
37
|
+
<font size="15"/>
|
38
|
+
</textElement>
|
39
|
+
<textFieldExpression><![CDATA[$P{undefined_parameter}]]></textFieldExpression>
|
40
|
+
</textField>
|
41
|
+
</band>
|
42
|
+
</title>
|
43
|
+
<pageHeader>
|
44
|
+
<band splitType="Stretch"/>
|
45
|
+
</pageHeader>
|
46
|
+
<columnHeader>
|
47
|
+
<band height="36" splitType="Stretch">
|
48
|
+
<line>
|
49
|
+
<reportElement uuid="6a63817d-d338-4966-9432-96e7baffc7f8" positionType="FixRelativeToBottom" x="0" y="35" width="555" height="1"/>
|
50
|
+
<graphicElement>
|
51
|
+
<pen lineWidth="0.5" lineColor="#999999"/>
|
52
|
+
</graphicElement>
|
53
|
+
</line>
|
54
|
+
<staticText>
|
55
|
+
<reportElement uuid="89d037e3-230c-4845-b0aa-a43920c60dc2" x="48" y="15" width="100" height="20"/>
|
56
|
+
<textElement/>
|
57
|
+
<text><![CDATA[name]]></text>
|
58
|
+
</staticText>
|
59
|
+
<staticText>
|
60
|
+
<reportElement uuid="6920786b-3719-4243-bee2-9e4073274cb1" x="245" y="15" width="100" height="20"/>
|
61
|
+
<textElement/>
|
62
|
+
<text><![CDATA[email]]></text>
|
63
|
+
</staticText>
|
64
|
+
</band>
|
65
|
+
</columnHeader>
|
66
|
+
<detail>
|
67
|
+
<band height="21" splitType="Stretch">
|
68
|
+
<textField>
|
69
|
+
<reportElement uuid="63d9b6a9-caa5-40d8-8bb0-41822dd43364" x="48" y="0" width="185" height="20"/>
|
70
|
+
<textElement/>
|
71
|
+
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
|
72
|
+
</textField>
|
73
|
+
<textField>
|
74
|
+
<reportElement uuid="83b41533-c6ed-4de6-8c48-5545c9c78e43" x="245" y="0" width="290" height="20"/>
|
75
|
+
<textElement/>
|
76
|
+
<textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
|
77
|
+
</textField>
|
78
|
+
</band>
|
79
|
+
</detail>
|
80
|
+
<columnFooter>
|
81
|
+
<band height="45" splitType="Stretch">
|
82
|
+
<line>
|
83
|
+
<reportElement uuid="9642b713-530f-4d6e-a4dd-b6e7b4d07e2b" positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1"/>
|
84
|
+
<graphicElement>
|
85
|
+
<pen lineWidth="0.5" lineColor="#999999"/>
|
86
|
+
</graphicElement>
|
87
|
+
</line>
|
88
|
+
</band>
|
89
|
+
</columnFooter>
|
90
|
+
<pageFooter>
|
91
|
+
<band height="20" splitType="Stretch">
|
92
|
+
<textField>
|
93
|
+
<reportElement uuid="06b23f1b-7ac0-4c70-bb2e-2aeb039f67a3" style="Column header" x="433" y="0" width="80" height="20"/>
|
94
|
+
<textElement textAlignment="Right">
|
95
|
+
<font size="10" isBold="false"/>
|
96
|
+
</textElement>
|
97
|
+
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
|
98
|
+
</textField>
|
99
|
+
<textField evaluationTime="Report">
|
100
|
+
<reportElement uuid="b8b7868e-fe9c-4e1b-8a24-75b97450ef73" style="Column header" x="513" y="0" width="40" height="20"/>
|
101
|
+
<textElement>
|
102
|
+
<font size="10" isBold="false"/>
|
103
|
+
</textElement>
|
104
|
+
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
|
105
|
+
</textField>
|
106
|
+
<textField pattern="EEEEE dd MMMMM yyyy">
|
107
|
+
<reportElement uuid="f924a532-c0df-4366-baad-4126ffb1462f" style="Column header" x="0" y="0" width="197" height="20"/>
|
108
|
+
<textElement>
|
109
|
+
<font size="10" isBold="false"/>
|
110
|
+
</textElement>
|
111
|
+
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
|
112
|
+
</textField>
|
113
|
+
</band>
|
114
|
+
</pageFooter>
|
115
|
+
<summary>
|
116
|
+
<band splitType="Stretch"/>
|
117
|
+
</summary>
|
118
|
+
</jasperReport>
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="index" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="311ea5a2-cc66-43bf-9af3-b2e0a552b1de">
|
3
|
+
<property name="ireport.zoom" value="1.0"/>
|
4
|
+
<property name="ireport.x" value="0"/>
|
5
|
+
<property name="ireport.y" value="0"/>
|
6
|
+
<style name="Title" forecolor="#FFFFFF" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
|
7
|
+
<style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="18"/>
|
8
|
+
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
|
9
|
+
<style name="Detail" fontName="Arial" fontSize="12"/>
|
10
|
+
<parameter name="parameter_defined_in_the_controller" class="java.lang.String"/>
|
11
|
+
<queryString language="xPath">
|
12
|
+
<![CDATA[/people/person]]>
|
13
|
+
</queryString>
|
14
|
+
<field name="name" class="java.lang.String">
|
15
|
+
<fieldDescription><![CDATA[name]]></fieldDescription>
|
16
|
+
</field>
|
17
|
+
<field name="email" class="java.lang.String">
|
18
|
+
<fieldDescription><![CDATA[email]]></fieldDescription>
|
19
|
+
</field>
|
20
|
+
<background>
|
21
|
+
<band splitType="Stretch"/>
|
22
|
+
</background>
|
23
|
+
<title>
|
24
|
+
<band height="70" splitType="Stretch">
|
25
|
+
<image>
|
26
|
+
<reportElement uuid="0b15b501-e65d-4f8b-b890-759a6d279efe" x="-20" y="0" width="595" height="64"/>
|
27
|
+
<imageExpression><![CDATA["wood.jpg"]]></imageExpression>
|
28
|
+
</image>
|
29
|
+
<staticText>
|
30
|
+
<reportElement uuid="dfeee47e-d32e-4525-a708-7cc3d6ec3f91" style="Title" x="0" y="5" width="263" height="33"/>
|
31
|
+
<textElement verticalAlignment="Middle"/>
|
32
|
+
<text><![CDATA[jasper-rails]]></text>
|
33
|
+
</staticText>
|
34
|
+
<textField>
|
35
|
+
<reportElement uuid="91699025-171b-40b4-ae45-eb9cdca69b2b" x="97" y="38" width="358" height="20" forecolor="#FFFFFF"/>
|
36
|
+
<textElement>
|
37
|
+
<font size="15"/>
|
38
|
+
</textElement>
|
39
|
+
<textFieldExpression><![CDATA[$P{parameter_defined_in_the_controller}]]></textFieldExpression>
|
40
|
+
</textField>
|
41
|
+
</band>
|
42
|
+
</title>
|
43
|
+
<pageHeader>
|
44
|
+
<band splitType="Stretch"/>
|
45
|
+
</pageHeader>
|
46
|
+
<columnHeader>
|
47
|
+
<band height="36" splitType="Stretch">
|
48
|
+
<line>
|
49
|
+
<reportElement uuid="6a63817d-d338-4966-9432-96e7baffc7f8" positionType="FixRelativeToBottom" x="0" y="35" width="555" height="1"/>
|
50
|
+
<graphicElement>
|
51
|
+
<pen lineWidth="0.5" lineColor="#999999"/>
|
52
|
+
</graphicElement>
|
53
|
+
</line>
|
54
|
+
<staticText>
|
55
|
+
<reportElement uuid="89d037e3-230c-4845-b0aa-a43920c60dc2" x="48" y="15" width="100" height="20"/>
|
56
|
+
<textElement/>
|
57
|
+
<text><![CDATA[name]]></text>
|
58
|
+
</staticText>
|
59
|
+
<staticText>
|
60
|
+
<reportElement uuid="6920786b-3719-4243-bee2-9e4073274cb1" x="245" y="15" width="100" height="20"/>
|
61
|
+
<textElement/>
|
62
|
+
<text><![CDATA[email]]></text>
|
63
|
+
</staticText>
|
64
|
+
</band>
|
65
|
+
</columnHeader>
|
66
|
+
<detail>
|
67
|
+
<band height="21" splitType="Stretch">
|
68
|
+
<textField>
|
69
|
+
<reportElement uuid="63d9b6a9-caa5-40d8-8bb0-41822dd43364" x="48" y="0" width="185" height="20"/>
|
70
|
+
<textElement/>
|
71
|
+
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
|
72
|
+
</textField>
|
73
|
+
<textField>
|
74
|
+
<reportElement uuid="83b41533-c6ed-4de6-8c48-5545c9c78e43" x="245" y="0" width="290" height="20"/>
|
75
|
+
<textElement/>
|
76
|
+
<textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
|
77
|
+
</textField>
|
78
|
+
</band>
|
79
|
+
</detail>
|
80
|
+
<columnFooter>
|
81
|
+
<band height="45" splitType="Stretch">
|
82
|
+
<line>
|
83
|
+
<reportElement uuid="9642b713-530f-4d6e-a4dd-b6e7b4d07e2b" positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1"/>
|
84
|
+
<graphicElement>
|
85
|
+
<pen lineWidth="0.5" lineColor="#999999"/>
|
86
|
+
</graphicElement>
|
87
|
+
</line>
|
88
|
+
</band>
|
89
|
+
</columnFooter>
|
90
|
+
<pageFooter>
|
91
|
+
<band height="20" splitType="Stretch">
|
92
|
+
<textField>
|
93
|
+
<reportElement uuid="06b23f1b-7ac0-4c70-bb2e-2aeb039f67a3" style="Column header" x="433" y="0" width="80" height="20"/>
|
94
|
+
<textElement textAlignment="Right">
|
95
|
+
<font size="10" isBold="false"/>
|
96
|
+
</textElement>
|
97
|
+
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
|
98
|
+
</textField>
|
99
|
+
<textField evaluationTime="Report">
|
100
|
+
<reportElement uuid="b8b7868e-fe9c-4e1b-8a24-75b97450ef73" style="Column header" x="513" y="0" width="40" height="20"/>
|
101
|
+
<textElement>
|
102
|
+
<font size="10" isBold="false"/>
|
103
|
+
</textElement>
|
104
|
+
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
|
105
|
+
</textField>
|
106
|
+
<textField pattern="EEEEE dd MMMMM yyyy">
|
107
|
+
<reportElement uuid="f924a532-c0df-4366-baad-4126ffb1462f" style="Column header" x="0" y="0" width="197" height="20"/>
|
108
|
+
<textElement>
|
109
|
+
<font size="10" isBold="false"/>
|
110
|
+
</textElement>
|
111
|
+
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
|
112
|
+
</textField>
|
113
|
+
</band>
|
114
|
+
</pageFooter>
|
115
|
+
<summary>
|
116
|
+
<band splitType="Stretch"/>
|
117
|
+
</summary>
|
118
|
+
</jasperReport>
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="index" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="311ea5a2-cc66-43bf-9af3-b2e0a552b1de">
|
3
|
+
<property name="ireport.zoom" value="1.0"/>
|
4
|
+
<property name="ireport.x" value="0"/>
|
5
|
+
<property name="ireport.y" value="0"/>
|
6
|
+
<style name="Title" forecolor="#FFFFFF" fontName="Arial" fontSize="26" isBold="true" pdfFontName="Helvetica-Bold"/>
|
7
|
+
<style name="SubTitle" forecolor="#666666" fontName="Arial" fontSize="18"/>
|
8
|
+
<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
|
9
|
+
<style name="Detail" fontName="Arial" fontSize="12"/>
|
10
|
+
<parameter name="parameter_defined_in_the_controller" class="java.lang.String"/>
|
11
|
+
<queryString language="xPath">
|
12
|
+
<![CDATA[]]>
|
13
|
+
</queryString>
|
14
|
+
<field name="name" class="java.lang.String">
|
15
|
+
<fieldDescription><![CDATA[name]]></fieldDescription>
|
16
|
+
</field>
|
17
|
+
<field name="email" class="java.lang.String">
|
18
|
+
<fieldDescription><![CDATA[email]]></fieldDescription>
|
19
|
+
</field>
|
20
|
+
<background>
|
21
|
+
<band splitType="Stretch"/>
|
22
|
+
</background>
|
23
|
+
<title>
|
24
|
+
<band height="70" splitType="Stretch">
|
25
|
+
<image>
|
26
|
+
<reportElement uuid="0b15b501-e65d-4f8b-b890-759a6d279efe" x="-20" y="0" width="595" height="64"/>
|
27
|
+
<imageExpression><![CDATA["wood.jpg"]]></imageExpression>
|
28
|
+
</image>
|
29
|
+
<staticText>
|
30
|
+
<reportElement uuid="dfeee47e-d32e-4525-a708-7cc3d6ec3f91" style="Title" x="0" y="5" width="342" height="33"/>
|
31
|
+
<textElement verticalAlignment="Middle"/>
|
32
|
+
<text><![CDATA[I don't have a query string]]></text>
|
33
|
+
</staticText>
|
34
|
+
</band>
|
35
|
+
</title>
|
36
|
+
<pageHeader>
|
37
|
+
<band splitType="Stretch"/>
|
38
|
+
</pageHeader>
|
39
|
+
<columnHeader>
|
40
|
+
<band height="36" splitType="Stretch">
|
41
|
+
<line>
|
42
|
+
<reportElement uuid="6a63817d-d338-4966-9432-96e7baffc7f8" positionType="FixRelativeToBottom" x="0" y="35" width="555" height="1"/>
|
43
|
+
<graphicElement>
|
44
|
+
<pen lineWidth="0.5" lineColor="#999999"/>
|
45
|
+
</graphicElement>
|
46
|
+
</line>
|
47
|
+
</band>
|
48
|
+
</columnHeader>
|
49
|
+
<detail>
|
50
|
+
<band height="21" splitType="Stretch"/>
|
51
|
+
</detail>
|
52
|
+
<columnFooter>
|
53
|
+
<band height="45" splitType="Stretch">
|
54
|
+
<line>
|
55
|
+
<reportElement uuid="9642b713-530f-4d6e-a4dd-b6e7b4d07e2b" positionType="FixRelativeToBottom" x="0" y="3" width="555" height="1"/>
|
56
|
+
<graphicElement>
|
57
|
+
<pen lineWidth="0.5" lineColor="#999999"/>
|
58
|
+
</graphicElement>
|
59
|
+
</line>
|
60
|
+
</band>
|
61
|
+
</columnFooter>
|
62
|
+
<pageFooter>
|
63
|
+
<band height="20" splitType="Stretch">
|
64
|
+
<textField>
|
65
|
+
<reportElement uuid="06b23f1b-7ac0-4c70-bb2e-2aeb039f67a3" style="Column header" x="433" y="0" width="80" height="20"/>
|
66
|
+
<textElement textAlignment="Right">
|
67
|
+
<font size="10" isBold="false"/>
|
68
|
+
</textElement>
|
69
|
+
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
|
70
|
+
</textField>
|
71
|
+
<textField evaluationTime="Report">
|
72
|
+
<reportElement uuid="b8b7868e-fe9c-4e1b-8a24-75b97450ef73" style="Column header" x="513" y="0" width="40" height="20"/>
|
73
|
+
<textElement>
|
74
|
+
<font size="10" isBold="false"/>
|
75
|
+
</textElement>
|
76
|
+
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
|
77
|
+
</textField>
|
78
|
+
<textField pattern="EEEEE dd MMMMM yyyy">
|
79
|
+
<reportElement uuid="f924a532-c0df-4366-baad-4126ffb1462f" style="Column header" x="0" y="0" width="197" height="20"/>
|
80
|
+
<textElement>
|
81
|
+
<font size="10" isBold="false"/>
|
82
|
+
</textElement>
|
83
|
+
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
|
84
|
+
</textField>
|
85
|
+
</band>
|
86
|
+
</pageFooter>
|
87
|
+
<summary>
|
88
|
+
<band splitType="Stretch"/>
|
89
|
+
</summary>
|
90
|
+
</jasperReport>
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
*.log
|
data/spec/spec_helper.rb
ADDED
metadata
CHANGED
@@ -1,51 +1,93 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasper-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Marlus Saraiva
|
13
9
|
- Rodrigo Maia
|
14
10
|
autorequire:
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-10-11 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
22
16
|
name: rjb
|
23
|
-
|
24
|
-
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 1
|
30
|
-
- 4
|
31
|
-
- 0
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
32
22
|
version: 1.4.0
|
33
23
|
type: :runtime
|
34
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 1.4.0
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: combustion
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 0.3.2
|
39
|
+
type: :development
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ~>
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.3.2
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec-rails
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: jasper-rails-rspec
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
35
79
|
description: Generate pdf reports on Rails using Jasper Reports reporting tool
|
36
80
|
email: rodrigomaia@grupofortes.com.br
|
37
81
|
executables: []
|
38
|
-
|
39
82
|
extensions: []
|
40
|
-
|
41
83
|
extra_rdoc_files: []
|
42
|
-
|
43
|
-
files:
|
84
|
+
files:
|
44
85
|
- .gitignore
|
45
86
|
- Gemfile
|
46
87
|
- LICENSE.txt
|
47
88
|
- README.md
|
48
89
|
- Rakefile
|
90
|
+
- config.ru
|
49
91
|
- jasper-rails.gemspec
|
50
92
|
- lib/jasper-rails.rb
|
51
93
|
- lib/jasper-rails/version.rb
|
@@ -59,35 +101,50 @@ files:
|
|
59
101
|
- lib/java/jcommon-1.0.15.jar
|
60
102
|
- lib/java/jfreechart-1.0.12.jar
|
61
103
|
- lib/java/xalan.jar
|
62
|
-
|
104
|
+
- spec/controllers/people_controller_spec.rb
|
105
|
+
- spec/internal/app/controllers/people_controller.rb
|
106
|
+
- spec/internal/app/models/person.rb
|
107
|
+
- spec/internal/app/views/people/compile_time_error_report.jrxml
|
108
|
+
- spec/internal/app/views/people/index.jasper
|
109
|
+
- spec/internal/app/views/people/index.jrxml
|
110
|
+
- spec/internal/app/views/people/runtime_error_report.jrxml
|
111
|
+
- spec/internal/app/views/people/wood.jpg
|
112
|
+
- spec/internal/config/routes.rb
|
113
|
+
- spec/internal/log/.gitignore
|
114
|
+
- spec/spec_helper.rb
|
63
115
|
homepage: https://github.com/fortesinformatica/jasper-rails
|
64
116
|
licenses: []
|
65
|
-
|
66
117
|
post_install_message:
|
67
118
|
rdoc_options: []
|
68
|
-
|
69
|
-
require_paths:
|
119
|
+
require_paths:
|
70
120
|
- lib
|
71
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
|
83
|
-
- 0
|
84
|
-
version: "0"
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
85
133
|
requirements: []
|
86
|
-
|
87
134
|
rubyforge_project:
|
88
|
-
rubygems_version: 1.
|
135
|
+
rubygems_version: 1.8.24
|
89
136
|
signing_key:
|
90
137
|
specification_version: 3
|
91
138
|
summary: Rails and JasperReports integration
|
92
|
-
test_files:
|
93
|
-
|
139
|
+
test_files:
|
140
|
+
- spec/controllers/people_controller_spec.rb
|
141
|
+
- spec/internal/app/controllers/people_controller.rb
|
142
|
+
- spec/internal/app/models/person.rb
|
143
|
+
- spec/internal/app/views/people/compile_time_error_report.jrxml
|
144
|
+
- spec/internal/app/views/people/index.jasper
|
145
|
+
- spec/internal/app/views/people/index.jrxml
|
146
|
+
- spec/internal/app/views/people/runtime_error_report.jrxml
|
147
|
+
- spec/internal/app/views/people/wood.jpg
|
148
|
+
- spec/internal/config/routes.rb
|
149
|
+
- spec/internal/log/.gitignore
|
150
|
+
- spec/spec_helper.rb
|