Using the Actuate JavaScript API
Actuate provides a JavaScript API (JSAPI) to support the integration of Actuate technology with web applications. Application developers can use the API to embed entire reports or individual report elements, such as charts or tables, into existing web pages.
HTML button event handlers can also use JSAPI to access report elements, manipulate data, and refresh a report in the Actuate viewer. For example, you can use the JSAPI to implement interactive functionality in the viewer, such as sorting and filtering data, linking to other report elements, and displaying or hiding report elements.
The three HTML buttons in the report shown in Figure 22-1, which provide three data filtering options, use methods in the JSAPI to get the current viewer, create the filters, and reload the report with new data each time the user clicks one of the buttons. The following is the event handler code for the Top Ten Products button:
this.onclick = function(event)
{
  //Get the current viewer object and the table with the
  //bookmark DetailTable on the current page.
  var viewer = this.getViewer();
  var pagecontents = viewer.getCurrentPageContent();
  var table = pagecontents.getTableByBookmark("DetailTable");
 
  //Create a top 10 filter on the table
  table.setFilters(new actuate.data.Filter("PRICE", actuate.data.Filter.TOP_N, "10"));
 
  //Reload the table
  table.submit();
}
The following is the event handler code for the All Products button:
this.onclick = function(event)
{
  var viewer = this.getViewer();
  var pagecontents = viewer.getCurrentPageContent();
  var table = pagecontents.getTableByBookmark("DetailTable");
  table.clearFilters("PRICE");
  table.submit();
}
The JSAPI provides many classes and methods that are useful for adding functionality to HTML buttons. For more information about using the JSAPI, see Using Actuate JavaScript API.

Additional Links:

Copyright Actuate Corporation 2012