Anchor | ||||
---|---|---|---|---|
|
Table of Contents | ||
---|---|---|
|
Tips
...
<div style="padding: 10px; border: 1px solid black;">
<div id="myReport">
</div>
</div>
<script type="text/javascript">
yellowfin.loadReport({reportUUID: 'e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63', elementId: 'myReport' });
</script>
...
<div style="padding: 10px; border: 1px solid black;">
<script type="text/javascript" src="http://localhost/JsAPI?reportUUID=e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63&width=500&width=350"></script>
</div>
...
Troubleshooting
As mentioned previously, you can check the window.yellowfin
variable to determine if the Javascript API has been loaded successfully. For example, when using the basic method:
...
<script src="http://localhost/JsAPI?reportUUID=e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63&width=500&height=500" type="text/javascript"></script>
<script typt="text/javascript">
if (!window.yellowfin) {
alert('Error loading API');
}
</script>
When using the advanced method, you can use this to determine whether or not to attempt to load a report or dashboard:
...
<script src="http://localhost/JsAPI" type="text/javascript"></script>
<script typt="text/javascript">
if (window.yellowfin) {
yellowfin.loadReport({reportUUID: 'e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63',
elementId: 'myReport' });
} else {
alert('Error loading API');
}
</script>
Errors encountered when using the API are generally presented through Javascript alerts. These include a description of the error. Common errors include:
...
Error
...
Description
...
API version requested is not supported
...
The server does not support the API version requested.
...
reportUUID not specified
...
The yellowfin.loadReport
function is called without a report identifier (reportUUID
, reportId
or wsName
).
...
Report not found
...
The report specified by the reportUUID
, reportId
or wsName
could not be found.
...
Report not loaded
...
An operation has been attempted on a report that has not yet been loaded.
...
Report is in draft mode
...
The report specified is in draft mode. Only active reports can be accessed through the Javascript API.
...
User does not have access to this report
...
The user logged in does not have access to the requested report.
...
Invalid command specified
Invalid request
...
An invalid request has been made to the API.
...
Error loading report
Error running report
Error running report command
Error loading dashboard
...
A server-side error occurred while running an API command. Check the Yellowfin server logs for more information.
...
dashUUID not specified
...
The yellowfin.loadDash
function is called without a dashboard identifier (dashUUID
).
...
Dashboard not found
...
The dashboard specified by the dashUUID
could not be found.
...
User does not have access to this dashboard
...
The user logged in does not have access to the requested dashboard.
...
Dashboard is in draft mode
...
ヒント