TableView - REST API Integration
Table API usage
HTML
<div id="dataView"></div>
<link rel="stylesheet" href="http://172.21.0.28:8080/jasperserver-pro" type="text/css" media="screen">
<script>
require = {
baseUrl: "http://localhost:8080/jasperserver-pro/scripts"
}
</script>
<script type="text/javascript" src="http://localhost:8080/jasperserver-pro/scripts/lib/require-jquery-2.1.2.js"></script>
<script type="text/javascript" src="http://localhost:8080/jasperserver-pro/scripts/adHocView.require.config.js"></script>
<style>
td.group {
background-color: #e7ecF2;
}
td.total {
background-color: #F0F4F8;
}
</style>
CSS
#typeChooser {
width: 250px;
}
#dataSelector {
width: 250px;
}
.slider {
width: 200px;
}
body {
font-size: 11px;
line-height: 1.182em;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: normal;
}
.tooltip {
position: absolute;
padding: 4px;
text-align: center;
background: #eee;
border: solid 1px #ccc;
z-index: 1000;
display: none;
white-space: nowrap;
}
.sliderTick {
position: absolute;
background: url(http://gavmacbook.local:8080/jasperserver-pro-adv/themes/default/images/slider_tickMark.png);
width: 3px;
height: 23px;
top: -4px;
z-index: 0;
margin-left: -1px;
}
.sliderContainer {
padding-top: 15px;
}
.tickOverlay {
position: absolute;
height: 23px;
width: 20px;
left: -10px;
}
#container {
background-color: #E6E6FA;
overflow: hidden;
}
#container > div {
border: 1px solid #aaa;
}
/*! perfect-scrollbar - v0.4.6
* http://noraesae.github.com/perfect-scrollbar/
* Copyright (c) 2013 HyeonJe Jun; Licensed MIT */
.ps-container .ps-scrollbar-x-rail{position:absolute;bottom:3px;height:8px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;opacity:0.7;filter:alpha(opacity=70);-o-transition:background-color .2s linear,opacity .2s linear;-webkit-transition:background-color.2s linear,opacity .2s linear;-moz-transition:background-color .2s linear,opacity .2s linear;transition:background-color .2s linear,opacity .2s linear}.ps-container:hover .ps-scrollbar-x-rail,.ps-container.hover .ps-scrollbar-x-rail{opacity:.6;filter:alpha(opacity=60)}.ps-container .ps-scrollbar-x-rail:hover,.ps-container .ps-scrollbar-x-rail.hover{/*background-color:#eee;*/opacity:.9;filter:alpha(opacity=90)}.ps-container .ps-scrollbar-x-rail.in-scrolling{opacity:.9;filter:alpha(opacity=90)}.ps-container...
JavaScript
require(["jquery", "adhoc/api/AdHocViewFacade", "common/transport/xdmRequest"], function($, AdHocView, request) {
"use strict";
request.configure({urlContext: "http://build-master.jaspersoft.com:5780/jrs-pro-feature-amber-adhoc-rest-api"});
var adHocView = new AdHocView({
container: "#dataView"
});
adHocView.run("/public/Samples/Ad_Hoc_Views/4_Product_Results_by_Store_Type").then(function() {
adHocView.components.table.detailsAndTotals(true);
});
});