Skip to content

Instantly share code, notes, and snippets.

@arunkjn
Last active December 28, 2015 15:49
Show Gist options
  • Save arunkjn/7524214 to your computer and use it in GitHub Desktop.
Save arunkjn/7524214 to your computer and use it in GitHub Desktop.
IPC Demo
<div ng-controller="IpcDemoCtrl">
<!-- Suppress firstname and supply lastname from scope.ipcLastName variable -->
<bi-report id="{{reportID}}" ip-firstname ip-lastname="ipcLastName"></bi-report>
<!-- Supply absolute value (or direct value) of lastname input control -->
<bi-report id="{{reportID}}" ip-abs-lastname="STALLONE;WAHLBERG;DEGENERES"></bi-report>
<!-- Supply absolute value (or direct value) of firstname input control -->
<bi-report id="{{reportID}}" ip-abs-firstname="NICK"></bi-report>
</div>
function IpcDemoCtrl($scope) {
// initialize the required scope variables
$scope.reportID = "52428d67a782784d22000001";
$scope.ipcLastName = ["STALLONE","WAHLBERG","DEGENERES"];
}
// A sample preview of the demo report
[
{
"_id": "523ad6f1b8342dc614000001",
"fields": [
"total_films",
"total_rental_rate",
"name"
],
"name": "Top Actor + Rental By Name",
"query": "select count(*) as total_films" +
"sum(f.rental_rate) as total_rental_rate," +
"a.first_name as name from " +
"actor a inner join film_actor fa on a.actor_id = fa.actor_id " +
"inner join film f on f.film_id = fa.film_id " +
"where a.last_name in ({{last_name}}) " +
"group by a.actor_id, a.first_name " +
"limit 20;"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment