Loading visualizations by bookmark name
BIRT report visualizations are loaded using their bookmark names. After locating or generating a valid report, BIRT Aviatio loads the visualizations from the report into the web page. The following loadBookmarks function is used to load the visualizations into the DIV tags of the application:
$scope.loadBookmarks = function (fileName) {
$scope.loadBookmark(fileName, "percentage", "percentage", 575, 245);
$scope.loadBookmark(fileName, "average", "average", 575, 250);
$scope.loadBookmark(fileName, "causes", "causes", 130, 515);
$scope.loadBookmark(fileName, "busiest_worst", "busiest_worst", 732, 70);
The loadBookmark function uses Actuate JSAPI to load each visualization into the correct DIV tag of the HTML page. The following code loads each bookmark from the selected state report:
$scope.loadBookmark = function (fileName, bookmark, divId, width, height) {
var viewer = new actuate.Viewer( divId);
viewer.setReportName( fileName );
viewer.setSize(width, height);
var options = new actuate.viewer.UIOptions( );
options.enableToolBar(false);
options.enableToolbarContextMenu(false);
viewer.setUIOptions( options );
viewer.setReportletBookmark(bookmark);
viewer.registerEventHandler(actuate.viewer.impl.EventConstants.ON_EXCEPTION,
function() {
console.log(divId + " render error");
$scope.done.push(divId);
}
);
See the source code for the complete example.