Like what you see? Have a play with our trial version.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
top
top

Note

As of Yellowfin version 9.2, JavaScript API v3 has been released. This API supersedes and replaces the existing v2 API. Until otherwise advised, the Version 2 API will continue to be supported but will not be enhanced. Information on this v3 API can be found here.


Table of Contents
classcontents

Overview


Styleclass
ClasstopLink

37061386top

Using the JavaScript API version 2, Yellowfin Reports and Dashboards can be embedded into external webpages, which can be hosted on a separate web server to Yellowfin. The only requirement is that the end user's browser be able to access the Yellowfin server. This is achieved by placing a scriptlet into the HTML code. The following example shows what a JavaScript scriptlet looks like:

...

The example scriptlet above will render a report within the enclosing page. If the user does not have a current session on the instance that the embedded report is coming from, the user will be prompted to log in unless the Guest User login is enabled and the displayed content is not secured. For more details, see the User Access section below.

If the embedded report is being used on a dynamic page or portal, a SSO can be used to automatically log the user in, using Yellowfin's LOGINUSER web service. The token is appended to the URL (how to use the token with JavaScript API link).

The widget that is embedded cannot be greatly styled or modified. A compromise needs to be made between ease of integration with the JSAPI with limited customizability or complex integration using the Report Service API with unrestricted customizability. Refer to the Limitations section below for more details.

...

Interactive elements such as Drill Through, Drill Down, User Prompt Filters, Series Selection, and Export to PDF are available.

Display

Styleclass
ClasstopLink

37061386


Report

The embedded report contains a Title Bar and the Report itself. The Title Bar contains the name of the report, as well as buttons to control any interactive elements used on the report. The interactive features include:


Description

Image Modified

Displays basic Report Information including; Name, Description, Last Modified Date, Category, Sub Category, and Current User

Image Modified

Displays the JavaScript used to embed the report

Image Modified

Allows the user to toggle to Chart view if Table and Chart display is used

Image Modified

Allows the user to toggle to Table view if Table and Chart display is used

Image Modified

Opens a panel of User Prompt Filters enabled on the report

Image Modified

Opens a Series Selection panel if the Visible Series Selection option is enabled

Image Modified

Opens a Unit Selection panel if the Visible Units Selection option is enabled

Image Modified

Opens a Page Navigation panel if the report contains multiple pages

Image Modified

Opens a Section Navigation panel if the report contains sections

Image Modified

Opens the GIS Map Navigation panel if the map has Hover Navigation enabled

Image Modified

Opens the Export panel, allowing the user to export the report to various formats, including:

  • Image Modified Export to CSV
  • Image Modified Export to DOC
  • Image Modified Export to PDF
  • Image Modified Export to Rich Text Format
  • Image Modified Export to Text
  • Image Modified Export to XLS

Dashboard

The embedded dashboard contains a Title Bar for the entire dashboard, and then each of the dashboard reports (displayed the same as embedded reports), laid out the same way as they are when viewed through the Yellowfin front end.
Note: dashboard filters and KPI dashboards are supported.


Description

Image Modified

Displays basic Dashboard Information including; Name, Description, Last Modified Date, and Current User

Image Modified

Displays the Javascript used to embed the dashboard

Image Modified

Opens a panel of User Prompt Filters enabled on the dashboard

Image Modified

Opens the Export panel, allowing the user to export the dashboard to various formats, including:

  • Image Modified Export to CSV
  • Image Modified Export to DOC
  • Image Modified Export to PDF
  • Image Modified Export to Rich Text Format
  • Image Modified Export to XLS

Example Usage

...

...

ClasstopLink

...

37061386


Embedding a Report

Using the Share menu, copy the Embed JavaScript, which identifies the report to load, for use in your HTML page, wiki, or blog. It will take a form similar to this:

...

Anchor
userAccess
userAccess

User Access

...

...

37061386

Users are authenticated when accessing a report or dashboard through the Javascript API. If a user has not yet logged in, they may be able to view the content as a Guest user. (Click here to learn how to do this.) There are a number of factors used to determine whether a report or dashboard can be run as a Guest user, or whether unauthenticated users are required to log in.

...

Authentication details can be passed to the API when the dashboard or report is loaded, either by passing a username and password, or authenticating via web services and passing the login token to the API. This allows you to use a specific user to load content rather than requiring the user to enter their details.

...

When a user enters their Yellowfin username and password to log in to the Javascript API, a cookie is stored in their browser to remember the user they logged in with. The next time they visit a page that includes a report or dashboard embedded using the Javascript API, they will automatically be logged in again using the same user. This prevents users from needing to enter their details every time they request a report or dashboard. By default, the cookie is valid for seven days from the last time the user logs in. This period can be changed by setting the External API cookie timeout value in Administration > Configuration > System > General Settings. To disable the cookie altogether, set the value to 0.

Note: The cookie value stored in the browser is encrypted. The cookie will not work across a restart of Yellowfin (i.e. when Yellowfin is restarted, all users will be required to log in again).

Anchor
limitations
limitations

Limitations

...

...

ClasstopLink

...

37061386

The current limitations of the Javascript API include:

...

horizontalrule

Styleclass
ClasstopLink

37061386top