Embedding reports with JsAPI v3: Anyone knows how to set the div where reports are embedded?

Diogo Thomaz shared this question 3 years ago
Answered

I'm trying to switch to JsAPI v3. In the previous API (2.1) we could use the elementId to set the div where reports would be embedded and it was easy to design the page.

How can I do this with v3?

Thanks for your help.

Diogo

Replies (2)

photo
1

Hi Diogo,

This is still possible with the JsAPI v3, though the syntax is a little different. To set the required element in the JsAPI v3, the parameter is now "element" instead of "elementID". The following is an example of how this works:

<script src="https://localhost:8080/JsAPI/v3"></script>
<div id="reportDiv"></div>
<script>
yellowfin.init().then(() => {
 //The Yellowfin base API has now loaded. Now load a report
  yellowfin.loadReport({
    reportId: 'c83357db-8aef-4ec7-ab72-fce34de9ee77',
    element: document.querySelector('div#reportDiv'),
  });
});
</script>

You can find an updated specification for the new JsAPI v3 here in our wiki.

Please let me know if you have any further questions on this.

Cheers,

Neal

photo
1

Thank you Neal.

Very helpful.

Regards,

Diogo

Leave a Comment
 
Attach a file