Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Anchor
top
top

Table of Contents
classcontents

Tips

  1. The enclosing element should be a block-level element, such as a div
  2. The enclosing element should have no padding or border. If you want a border or padding around your report or dashboard you should enclose the element in another element that has the padding or border. For example:
    Code Block
    html
    html
    
    <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>
    

...

  1. If

...

  1. you

...

  1. are

...

  1. using

...

  1. the

...

  1. basic

...

  1. method,

...

  1. and

...

  1. do

...

  1. not

...

  1. pass

...

  1. an

...

  1. elementId

...

  1. to

...

  1. the

...

  1. API,

...

  1. the

...

  1. enclosing

...

  1. element

...

  1. is

...

  1. created

...

  1. automatically.

...

  1. You

...

  1. can

...

  1. enclose

...

  1. the

...

  1. script

...

  1. tag

...

  1. in

...

  1. another

...

  1. element

...

  1. with

...

  1. padding

...

  1. or

...

  1. border

...

  1. styles

...

  1. applied.

...

  1. For

...

  1. example:

...

  1. Code Block
    html
    html
    
    <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>
    

...

  1. For reports,

...

  1. the

...

  1. enclosing

...

  1. element

...

  1. should

...

  1. have

...

  1. a

...

  1. fixed

...

  1. height/width.

...


  1. For

...

  1. chart

...

  1. only

...

  1. reports,

...

  1. the

...

  1. chart

...

  1. will

...

  1. be

...

  1. renedered

...

  1. to

...

  1. fit

...

  1. within

...

  1. the

...

  1. enclosing

...

  1. element.

...

  1. In

...

  1. case

...

  1. a

...

  1. report

...

  1. does

...

  1. not

...

  1. fit

...

  1. within

...

  1. the

...

  1. element,

...

  1. scrollbars

...

  1. will

...

  1. be

...

  1. included,

...

  1. so

...

  1. the

...

  1. rest

...

  1. of

...

  1. your

...

  1. page

...

  1. layout

...

  1. is

...

  1. not

...

  1. affected.

...


  1. If

...

  1. you

...

  1. do

...

  1. not

...

  1. include

...

  1. a

...

  1. fixed

...

  1. height

...

  1. and

...

  1. width

...

  1. on

...

  1. your

...

  1. element,

...

  1. the

...

  1. browser

...

  1. will

...

  1. choose

...

  1. how

...

  1. to

...

  1. layout

...

  1. the

...

  1. report.

...

  1. This

...

  1. may

...

  1. mean

...

  1. that

...

  1. the

...

  1. report

...

  1. will

...

  1. increase

...

  1. or

...

  1. decrease

...

  1. in

...

  1. size

...

  1. when

...

  1. different

...

  1. options

...

  1. are

...

  1. clicked

...

  1. by

...

  1. the

...

  1. user.

...

  1. This

...

  1. may

...

  1. be

...

  1. preferable

...

  1. in

...

  1. some

...

  1. cases.

...

  1. Make

...

  1. sure

...

  1. the

...

  1. Javascript

...

  1. API

...

  1. URL

...

  1. is

...

  1. accessible

...

  1. for

...

  1. any

...

  1. end-users.

...

  1. Avoid

...

  1. using

...

  1. localhost

...

  1. or

...

  1. private

...

  1. IP

...

  1. addresses.

...

  1. Your

...

  1. HTML

...

  1. should

...

  1. be

...

  1. well-structured

...

  1. where

...

  1. possible.

...

  1. For

...

  1. example,

...

  1. you

...

  1. may

...

  1. have

...

  1. problems

...

  1. with

...

  1. the

...

  1. API

...

  1. if

...

  1. you

...

  1. do

...

  1. not

...

  1. have

...

  1. a

...

  1. <body>

...

  1. tag.

...

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:

Code Block
javascript
javascript
<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>
{code}

When

...

using

...

the

...

advanced

...

method,

...

you

...

can

...

use

...

this

...

to

...

determine

...

whether

...

or

...

not

...

to

...

attempt

...

to

...

load

...

a

...

report

...

or

...

dashboard:

...

Code Block
javascript
javascript
<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>
{code}

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

The dashboard specified is in draft mode. Only active dashboards can be accessed through the Javascript API.