forked from marianol/JasperEmbedSample
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreportInteraction.html
executable file
·173 lines (143 loc) · 5.3 KB
/
reportInteraction.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<!--
* ========================================================================
* reportInteraction.html
*
* ========================================================================
* Copyright 2013
* Author: Bing Wang
* Author: Mariano Luna
*
* Unless you have purchased a commercial license agreement from Jaspersoft Inc., the following license terms apply:
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
* ======================================================================== */
-->
<html lang="en">
<head>
<title>Report Interaction - JRS Embedded Demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/styles.css" rel="stylesheet">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="http://localhost:8080/jasperserver-pro/bif/visualize.js"></script>
<script src="js/visualizeHelper.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
<script type="text/JavaScript">
var myReport;
// Initialize Visualize.js
BIF.init({
domain: 'http://localhost:8080/jasperserver-pro',
mods: ['reports']
}, function(Reports) {
jsReportUnit = Reports;
initializeReports();
}
);
// Now using the funtions in visualizeHelper.js
function initializeReports() {
var report_uri = '/public/SalesPerCityReport';
myReport = runReport(report_uri, 'report2');
}
</script>
<style type="text/css">
#repo h3 {
padding: 5px 0;
margin: 0;
}
#repo table {
border-collapse: collapse;
}
#repo td {
border: solid 1px #eee;
padding: 4px 0;
}
.fill { top:20; right:0; bottom:0; left:0}
#overlay { background: #333; opacity: 0.33}
#ajax-icon { width:64px; height: 64px; margin:auto; color: #fff; text-align: center}
.mygrid-wrapper-div {
overflow: scroll;
height: 400px;
}
</style>
</head>
<body onLoad="">
<div class="navbar navbar-inverse navbar-static-top">
<div class="container" style="width:100%; ">
<a href="#" class="navbar-brand">Jaspersoft Portal</a>
<button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="collapse navbar-collapse navHeaderCollapse">
<ul class="nav navbar-nav navbar-right">
<li class="active"><a href="index.html">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Extra Samples <b class="caret"></b><a/>
<ul class="dropdown-menu">
<li><a href="context-ic.html">Contextual Input Controls</a></li>
<li><a href="reportInteraction.html">External Report Interaction</a></li>
<li><a href="reportInteraction2.html">Report Interaction</a></li>
<li><a href="reportPopup.html">Report Popup</a></li>
</ul>
</li>
<li><a href="http://github.com/marianol/JasperEmbedSample">About</a></li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-6">
<h3><a href="#">Location Map</a></h3>
<div id="map" style="width:100%; height:400px;"></div>
<script type="text/javascript">
var locations = [
['Alameda',37.765278, -122.240556,5],
['Los Angeles',34.052222, -118.242778,4],
['San Diego',32.715278, -117.156389,3],
['San Francisco',37.775000, -122.418333,2],
['Beverly Hills',34.073611, -118.399444,1],
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: new google.maps.LatLng(34.052222, -118.242778),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
myReport.run({store_city_1: locations[i][0]})
infowindow.open(map, marker);
}
})(marker, i));
}
</script>
</div>
<div class="col-md-6">
<h3><a href="#">Sales by City</a></h3>
<div id="report2"></div>
</div>
</div>
</div>
</body>
</html>