Skip to main content

Through creation of analytic applications, SAP Analytics Cloud makes it possible to produce complex reporting scenarios for customers.  A building block which decisively complements this function is custom widgets which allow quick and user-centred creation of visualizations. Here we will show you how to create these and embed them in an SAC application.

The basic idea behind widgets in SAC

With its wide range of standard widgets, SAC fulfils many customer requirements for visualization. If no suitable widgets are included in the supplied standard scope, it is possible to develop your own. This allows very flexible report generation according to complex customer requirements. Similar to standard widgets, custom widgets are displayed in the widget menu bar, for example, and can be flexibly moved and resized in the graphics area, besides allowing a use of script methods.

Because a custom widget is technically a small web application, a knowledge of HTML and JavaScript is required for development. Consisting essentially of a JSON file and a JavaScript file, the widget can also include images as well as CSS and further JavaScript files, depending on its complexity. A created widget is implemented in an analytical application as a web component, or custom element which does not influence the rest of the HTML document object model (DOM).

Restrictions on the use of custom widgets

During development, a few limitations affecting subsequent use should be taken into account. To use custom widgets, it is necessary to work with Google Chrome or Microsoft Edge (version 79 or higher). In addition, the following functions are currently unavailable:

  • Data-change insights
  • Design and CSS
  • Publication planning
  • Widget commenting
  • Bookmarks
  • Pausing of updates
  • Search to insight
  • Translation
     

During a use of APIs, the following data connections are not supported:

  • getDataSource().openPromptDialog
  • getDataSource().getComments
  • getDataSource().load
  • getDataSource().getDataExplorer
  • getDataSource().getDataSelections

Structure of a custom widget

Different storage locations are used to host custom widgets. The JSON file is uploaded directly to the SAC tenant. In contrast, the resource files are uploaded to an HTTP server, which must support HTTPS and only functions as a storage location for the files. Resource files are never stored in an analytic application when it is invoked.

A custom widget consists of different components:

  • JSON reference document (defines a custom widget and references the respective components)
  • JavaScript web component (implements the user-defined element of the widget)
  • Format area JavaScript web component (optional)
  • Builder area JavaScript web component (optional)
  • Icons (optional)
  • Additional files (optional)

Integrating a custom widget

Once a custom widget has been developed, the JSON reference document is first imported via the plus button on the "Analytic Applications" tab in the "Custom Widgets" section.

The created widget can subsequently be found in the analytic-application development environment on the "Custom Widgets" tab and used for visualization. Each widget has a version number (major, minor, patch) to facilitate work with different versions of the  widget.

 

 

 

 

If we were able to help you but you still have questions about SAC custom widgets, feel free to contact us. We will be happy to support you in all matters concerning SAP Analytics Cloud.

 

Get in touch!

 

 

 

 

[Translate to English:]

Artikel teilen: