Examples of extensions

See additional examples for Extension visuals.

In the following examples, the definitions for Print dashboard and Download dashboard as PDF show how to perform these actions through an Extension visual. They have been implemented together, creating a visual that serves as an action panel within the dashboard.

Print dashboard

The following extension definition builds a (print) button with an icon. You can use this button to print the dashboard in View mode.

<div id="extension-print-btn">
  <button class="btn btn-xs btn-primary" 
  onclick="window.print();return false;">
  <span class="fa fa-print"></span> Print</button>
</div>

Download dashboard as PDF

The following extension definition builds a (download PDF) button with an icon. You can use this button to save the dashboard in PDF format from View mode.

<div id="extension-pdf-btn">
  <button class="pdf-download btn btn-xs btn-primary">
  <span class="fa fa-download"></span> Download PDF</button>
  <div class="image-dropdown-submenu"/>
</div>

Print dashboard and download PDF

The following definition creates two buttons in an Extension visual:

  • Print button with an icon
  • Download PDF button with an icon
<div id="extension-print-and-pdf-btn">
  <button class="btn btn-xs btn-primary" 
  onclick="window.print();return false;">
  <span class="fa fa-print"></span> Print</button>

  <button class="pdf-download btn btn-xs btn-primary">
  <span class="fa fa-download"></span> Download PDF</button>
  <div class="image-dropdown-submenu"/>
</div>

When you add this Extension visual to a dashboard, the dashboard will display print and download buttons: