How to: |
You may want to control an active report beyond the capabilities that are provided by Developer Studio. The Active Technologies feature has its own Application Programming Interface (API), which you can access as you develop reports.
This topic describes how to access the Active Technologies API with custom JavaScript code. It assumes that you have basic knowledge of JavaScript.
Access to an HTML object on an active dashboard relies on the name that you supply in Document Composer. The custom JavaScript code uses the name to refer to the object.
When you run the procedures with Active Technologies format types, the custom JavaScript file is integrated into the active report and the active dashboard that are generated. To use the Active Technologies API, you must first initialize it. You initialize the Active Technologies API by assigning a new activeReport object to a variable.
The custom function executes before any other JavaScript executes.
// ArApi is set to the activeReport object var ArApi = null; function user_init() { if(ArApi==null) ArApi=new getAReportObj(); // ADD CUSTOM CODE HERE }
// Values used in the following example var newValue = '<b>CONFIDENTIAL REVENUE REPORT</b>'; /* Here is an example of how a Text object created as part of an active report or active dashboard is accessed and modified at run time. Reference the object to modify, then Set the object with new text */ var obj = document.getElementById('Text_1'); if(obj) obj.innerHTML = newValue;
A set of three sample tabs is shown here.
Following is an example of code that adds the text Layouts in front of the tabs.
// This overwrites the text presented prior to the panels. ibiMsgStr['Layouts'] = "Layouts";
You can change the value in double quotation marks to specify the text that will be displayed. Blanks are allowed.
The following image shows the contents of a sample irpcusf.js file in the Developer Studio Text Editor.
In the following image, the text CONFIDENTIAL REVENUE REPORT is displayed, as supplied in the custom JavaScript code for the object that is named Text_1. The text Layouts, also supplied in the JavaScript code, precedes the tabs at the upper-left of the window.
WebFOCUS |