Page History
...
Table of Contents | ||
---|---|---|
|
...
概要
Styleclass | ||
---|---|---|
| ||
If you want to have more control over the loading of content, call reports or dashboards on demand, or set display options dynamically (based on user input), you can call the API directly from your own script.
...
Server Information
Styleclass | ||
---|---|---|
| ||
After loading the API, some server information is made available:
Expand | |
---|---|
|
...
| |
|
...
|
...
例
Code Block | ||||
---|---|---|---|---|
| ||||
<script src="http://localhost/JsAPI" type="text/javascript"></script> <script type="text/javascript"> if (window.yellowfin) { alert('Yellowfin API loaded. Version: ' + yellowfin.apiVersion); } </script> |
Loading a Report
Styleclass | ||
---|---|---|
| ||
A report is loaded by calling the yellowfin.loadReport
function:
...
Options are passed to the function as a Javascript object. These include a report identifier for the report you are loading, the elementId of the HTML element in which to load the report (or the element itself), and other options that alter the way the report is displayed. The available options are:
Expand | |
---|---|
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
例
This example loads a report into an element specified by its universal id, setting some initial display options:
...
Loading Report Filters
Styleclass | ||
---|---|---|
| ||
Filters used by a report can be loaded by calling the yellowfin.reports.loadReportFilters
function. To use this function, load the reports sub-API into your page along with the main API:
...
The filters object returned as the first argument to the callback function is an array containing any filters used in the report. Each element in the array is an object containing information about that filter. These filter objects contain the properties:
Expand | |
---|---|
|
...
|
...
|
...
|
...
|
...
|
...
例
This example loads the report filters and displayed them to the user:
Code Block | ||||
---|---|---|---|---|
| ||||
function filterCallback(filters) { for (var i = 0; i < filters.length; i++) { alert('Filter ' + filters[i].description説明 + ' (' + filters[i].filterUUID + '), display style: ' + filters[i].display); } } yellowfin.reports.loadReportFilters( 'e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63', filterCallback); |
...
Code Block | ||||
---|---|---|---|---|
| ||||
function filterCallback(filters) { var filterValues = {}; for (var i = 0; i < filters.length; i++) { if (filters[i].description説明 == 'Country') { filterValues[filters[i].filterUUID] = 'Australia'; } else if (filters[i].description説明 == 'Start Date') { filterValues[filters[i].filterUUID] = '2011-01-01'; } else if (filters[i].description説明 == 'Invoiced Amount') { filterValues[filters[i].filterUUID] = 6400; } } // set up other options to load the report var options = {}; options.reportUUID = 'e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63'; options.elementId = 'myReport'; // add the filter values options.filters = filterValues; // load the report yellowfin.loadReport(options); } yellowfin.reports.loadReportFilters( 'e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63', filterCallback); |
...
Loading a Dashboard
Styleclass | ||
---|---|---|
| ||
A dashboard is loaded by calling the yellowfin.loadDash
function:
...
Options are passed to the function as a Javascript object. These include an identifier for the dashboard you are loading, the elementId of the HTML element in which to load the dashboard (or the element itself), and other options that alter the way the dashboard is displayed. The available options are:
Expand | |
---|---|
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
例
This example loads a dashboard into an element specified by its id, setting some initial display options.
...
Loading Dashboard Filters
Styleclass | ||
---|---|---|
| ||
Filters used by a dashboard can be loaded by calling the yellowfin.dash.loadDashFilters
function. To use this function, load the dashboard sub-API into your page along with the main API:
...
The filters object returned as the first argument to the callback function is an array containing any analytical filters used in the dashboard, as well as filter group separators. Each element in the array is an object containing information about that filter or filter group. These objects contain the properties:
Expand | |
---|---|
|
...
|
...
|
...
|
...
|
...
|
...
例
This example loads the dashboard filters and displays them to the user:
Code Block | ||||
---|---|---|---|---|
| ||||
function filterCallback(filters) { for (var i = 0; i < filters.length; i++) { alert('Filter ' + filters[i].description説明 + ' (' + filters[i].key + '), display style: ' + filters[i].display); } } yellowfin.reports.loadReportFilters(1234, filterCallback); |
...
Code Block | ||||
---|---|---|---|---|
| ||||
function filterCallback(filters) { var filterValues = {}; for (var i = 0; i < filters.length; i++) { if (filters[i].description説明 == 'Country') { filterValues[filters[i].key] = 'Australia'; } else if (filters[i].description説明 == 'Start Date') { filterValues[filters[i].key] = '2011-01-01'; } else if (filters[i].description説明 == 'Invoiced Amount') { filterValues[filters[i].key] = 6400; } } // set up other options to load the dashboard var options = {}; options.dashUUID = '3b0b6c9a-9dfb-41f0-b85a-eb17bb8aeeb9'; options.elementId = 'myDash'; // add the filter values options.filters = filterValues; // load the dashboard yellowfin.loadDash(options); } yellowfin.dash.loadDashFilters('3b0b6c9a-9dfb-41f0-b85a-eb17bb8aeeb9', filterCallback); |
...
horizontalrule |
---|
Styleclass | ||
---|---|---|
| ||