Class actuate.XTabAnalyzer
Description
The XTabAnalyzer class represents an Interactive Crosstabs viewer, used to view and operate a cross tab.
Constructor
Syntax
actuate.XTabAnalyzer( )
Constructs a new Interactive Crosstabs object.
actuate.XTabAnalyzer(object xtabContainer, actuate.xtabanalyzer.UIOptions uiOptions)
actuate.XTabAnalyzer(string xtabContainerId, actuate.xtabanalyzer.UIOptions uiOptions)
Constructs a new Interactive Crosstabs object in the specified container.
Parameters
xtabContainer
Object. A document object referencing the HTML <div> element that contains the XTabAnalyzer viewer.
xtabContainerId
String. The value of the ID parameter for an HTML <div> element to hold the XTabAnalyzer viewer. For example, with 'containerName' as the xtabContainer parameter, a <DIV ID='containerName' /> tag on the page displays the viewer at the location of the <div> element.
uiOptions
actuate.xtabanalyzer.UIOptions object. Optional. UIOptions references display options for the viewer.
Function summary
Table 8‑2 lists actuate.XTabAnalyzer functions.
Table 8‑2 actuate.XTabAnalyzer functions
Function
Description
commit( )
Commits all changes to the report design
Forces the viewer to restart
Returns the Current Page Content object
Returns the current page number
Returns the gadget ID of the shown cross tab
Returns the viewer height
Returns the viewer left margin
Returns the parameter values
Returns the CSS position attribute value
getTop( )
Returns the viewer top margin
Returns the total page count
Returns the actuate.xtabanalyzer.UIOptions object assigned to this viewer
Gets a viewer within a container
Returns the viewer width
Returns the bookmark of the cross tab displayed in the viewer
Returns the instance ID of the cross tab displayed in the viewer
Checks if current viewer pop‑up is active
Checks if the current viewer pop‑up is a dashboard
Checks if the current viewer is interactive
Registers an event handler
Removes an event handler
reset( )
Resets the viewer object
Resizes the viewer
Rolls back all changes in the viewer and refreshes its content
Sets the gadget id of the cross tab
Sets the viewer height
Sets whether the viewer is in IV mode
Sets the viewer left margin
Sets callback when the pop‑up window is closed
Sets the page number
Sets the parameter values
Sets the CSS position attribute
Sets a Reportlet to document mode
Sets the report to load into the interactive cross tab
Sets the iHub System and request options
Sets whether or not the client browser supports SVG
setTop( )
Sets the top margin
Sets the user interface options for the viewer
Sets the viewer width
Sets a bookmark for the cross tab
Sets the instance ID of the cross tab
submit( )
Submits asynchronous operations and renders the requested components
commit
Syntax
void XTabAnalyzer.commit(function callback)
Commits all design changes to a generated document as a single operation. If ivMode is not set to true, call setIVMode( ) to set the value of ivMode to true before calling commit( ).
Parameter
callback
Function. The callback function called after commit finishes.
Example
This example opens a design with a cross tab and pivots the cross tab:
function pivot( ){
// Make a change to the cross tab
crosstab.pivot( );
crosstab.submit( );
viewer.commit( );
}
forceSoftRestart
Syntax
void XTabAnalyzer.forceSoftRestart( )
Forces the viewer to restart.
Example
This example restarts the viewer:
this.onclick = function(event){
forceSoftRestart( );
}
getCurrentPageContent
Syntax
actuate.xtabanalyzer.PageContent XTabAnalyzer.getCurrentPageContent( )
Returns the Current Page Content object.
Returns
actuate.xtabanalyzer.PageContent object. Content from the current page.
Example
This example retrieves the cross tab from the current page:
function getCrosstab(analyzerViewer){
var content = analyzerViewer.getCurrentPageContent( );
return content.getCrosstabByBookmark( );
}
getCurrentPageNum
Syntax
integer XTabAnalyzer.getCurrentPageNum( )
Returns the current page number.
Returns
Integer. The current page number.
Example
This example retrieves the page number:
function retrievePageNum( ){
return analyzerViewer.getCurrentPageNum( );
}
getGadgetId
Syntax
string XTabAnalyzer.getGadgetId( )
Returns the gadget ID of the shown cross tab. This function is used for dashboard integration.
Returns
String. A gadget ID.
Example
This example retrieves the gadget ID:
function retrieveGadgetID( ){
return analyzerViewer.getGadgetId( );
}
getHeight
Syntax
integer XTabAnalyzer.getHeight( )
Returns the height of the viewer.
Returns
Integer. The height in pixels.
Example
This example retrieves the current height of the viewer and doubles the height if the current height is lower than 630 pixels:
function doubleHeight( ){
var height = viewer.getHeight( );
if (height < 630){
viewer.setHeight(height * 2);
viewer.submit( );
}
}
getLeft
Syntax
integer XTabAnalyzer.getLeft( )
Returns the left margin of the viewer.
Returns
Integer. The left margin in pixels.
Example
This example retrieves the position of the viewer’s left margin and moves the margin 20 pixels to the right if the left margin is fewer than 45 pixels from the left edge of the screen:
function moveLeftMargin( ){
var left = viewer.getLeft( );
if (left < 45){
viewer.setLeft(left + 20);
viewer.submit( );
}
}
getParameterValues
Syntax
actuate.xtabanalyzer.ParameterValue[ ] XTabAnalyzer.getParameterValues( )
Returns the parameter values.
Returns
actuate.xtabanalyzer.ParameterValue[ ] or actuate.parameter.ParameterValue[ ]. An array of parameter values.
getPosition
Syntax
string XTabAnalyzer.getPosition( )
Returns the CSS position attribute for the viewer.
Returns
String. The CSS position attribute.
Example
This example changes the CSS positioning type from relative to absolute:
function changePosition( ){
if (viewer.getPosition( ) == 'relative'){
viewer.setPosition('absolute');
viewer.submit( );
}
}
getTop
Syntax
integer XTabAnalyzer.getTop( )
Returns the top margin of the viewer.
Returns
Integer. The top margin in pixels.
Example
This example retrieves the value for the viewer’s top margin and moves the margin 20 pixels down the screen if the margin was fewer than 45 pixels from the top of the screen:
function moveTopMargin( ){
var top = viewer.getTop( );
if (top < 45){
viewer.setTop(top + 20);
viewer.submit( );
}
}
getTotalPageCount
Syntax
integer XTabAnalyzer.getTotalPageCount( )
Returns the total page count.
Returns
Integer. The total number of pages.
Example
This example displays an alert with the total page count from viewer:
alert("Total pages: " + viewer.getTotalPageCount( ));
getUIOptions
Syntax
actuate.xtabanalyzer.UIOptions getUIOptions( )
Returns the user interface options object for the cross tab analyzer. The UIOptions object specifies what features are used within the viewer.
Returns
actuate.xtabanalyzer.UIOptions object. Interactive Crosstabs user interface options.
Example
This example retrieves the user interface options and sets one of the UIOptions values:
function resetUIOptions( ){
var options = viewer.getUIOptions( );
options.enableToolbar(false);
viewer.setUIOptions(options);
}
getViewer
Syntax
static XTabAnalyzer.getViewer(HTMLElement container)
Returns a viewer by container. To retrieve the viewer for the current object, do not specify a container. This function is useful to retrieve the instance ID for a specific viewer when there are multiple viewers on a page.
Parameter
container
HTMLElement. The container instance ID from which to retrieve the viewer.
Returns
XTabAnalyzer object. The Interactive Crosstabs viewer.
Example
This example retrieves the viewer:
function retrieveViewer( ){
return viewer.getViewer( );
}
getWidth
Syntax
string XTabAnalyzer.getWidth( )
Returns the width value of the viewer.
Returns
String. The width in pixels.
Example
This example retrieves the width of the viewer, then alters it based on the size:
function doubleWidth( ){
var width = viewer.getWidth( );
if (width < 630){
viewer.setWidth(width * 2);
viewer.submit( );
}
}
getXTabBookmark
Syntax
string XTabAnalyzer.getXTabBookmark( )
Returns the bookmark name for the cross tab set to render in the viewer.
Returns
String. The bookmark for a cross tab.
Example
This example retrieves the bookmark that the cross tab is associated with, changes the bookmark, and resets the bookmark. This functionality supports the use of multiple cross tab elements within a single design.
function changeBookmark( ){
var oldBookMark = viewer.getXTabBookmark( );
viewer.setXTabBookmark("crosstab2");
viewer.submit( );
}
getXTabIid
Syntax
string XTabAnalyzer.getXTabIid( )
Returns the current instance ID of the interactive cross tab. This function is useful in integration with Interactive Viewer and supports the ability of Interactive Viewer to obtain and use the interactive cross tab instance ID.
Returns
String. An interactive cross tab instance ID.
Example
This example retrieves the interactive cross tab instance ID:
function retrieveXTablid( myviewer ){
return myviewer.getXTablid( );
}
isActive
Syntax
boolean XTabAnalyzer.isActive( )
Returns true when an interactive cross tab pop-up is active and false otherwise.
Returns
Boolean. True indicates an active interactive cross tab pop-up window.
Example
This example checks if a viewer exists by checking two conditions: the viewer variable exists, or isActive( ) returns true. When both conditions fail, the example code creates a new viewer object within a container:
function checkViewer( ){
if(!viewer || !viewer.isActive( )){
viewer = new actuate.XTabAnalyzer(container);
}
}
isDashboard
Syntax
boolean XTabAnalyzer.isDashboard( )
Returns true when dashboard mode is active and false in all other cases.
Returns
Boolean. True indicates dashboard mode.
isInteractive
Syntax
boolean XTabAnalyzer.isInteractive( )
Returns whether this Interactive Crosstabs Viewer is in Interactive mode.
Returns
Boolean. True indicates dashboard mode.
Example
This example displays whether myDataAnalyzer is interactive:
alert("Interactive mode: " + myDataAnalyzer.isInteractive( ));
registerEventHandler
Syntax
void XTabAnalyzer.registerEventHandler(string viewerEvent, function handler)
Registers an event handler for the specified event. This function throws actuate.xtabanalyzer.Exception when invalid arguments are passed.
Parameters
viewerEvent
String. Specifies the event that triggers the handler call. For a list of supported events, see actuate.xtabanalyzer.EventConstants.
handler
Function. Called when the event occurs.
Example
This example changes an event handler from one function to another:
function changeEventHandler( event ){
viewer.removeEventHandler(
actuate.xtabanalyzer.EventConstants.ON_CONTENT_CHANGED, oldChangedHandler);
viewer.registerEventHandler(
actuate.xtabanalyzer.EventConstants.ON_CONTENT_CHANGED, newChangedHandler);
}
removeEventHandler
Syntax
void XTabAnalyzer.removeEventHandler(string viewerEvent, function handler)
Removes an event handler from the specified event. This function throws actuate.xtabanalyzer.Exception when invalid arguments are passed.
Parameters
viewerEvent
String. Specifies the event from which to remove the event handler. For a list of supported events, see actuate.xtabanalyzer.EventConstants.
handler
Function. The function to deregister from the event.
Example
This example changes an event handler from one function to another:
function changeEventHandler( event ){
viewer.removeEventHandler(
actuate.xtabanalyzer.EventConstants.ON_CONTENT_CHANGED, oldChangedHandler);
viewer.registerEventHandler(
actuate.xtabanalyzer.EventConstants.ON_CONTENT_CHANGED, newChangedHandler);
}
reset
Syntax
void XTabAnalyzer.reset( )
Resets the viewer to its initial state.
Example
This example resets the viewer. All changes to the viewer made prior to this call are discarded:
function resetViewer( ){
viewer.reset( );
}
resizeTo
Syntax
void XTabAnalyzer.resizeTo(integer width, integer height)
Resizes the viewer to the specified height and width.
Parameters
width
Integer. The width in pixels.
height
Integer. The height in pixels.
Example
This example resizes the viewer when the new width is fewer than 1000 pixels and the new height is fewer than 650 pixels:
function resizeViewer(width,height){
if ((width < 1000) && (height < 650)){
viewer.resizeTo(width,height);
}
}
rollback
Syntax
void XTabAnalyzer.rollback(function callback)
Rolls back all changes in the viewer since the last commit( ) call and refreshes the viewer’s content. The value of ivMode must be true for rollback( ) to function.
Parameter
callback
Function. The callback function called after rollback finishes.
Example
This example rolls back all changes to the viewer made since the last commit or submit function call:
function rollbackViewer( ){
viewer.rollback( );
}
setGadgetId
Syntax
void XTabAnalyzer.setGadgetId(string gadgetId)
Sets the cross tab gadget ID. This function is used for dashboard integration.
Parameter
gadgetId
String. The gadget ID used to render the cross tab.
Example
This example sets the gadget ID:
function setGadgetID(id){
viewer.setGadgetId(id);
}
setHeight
Syntax
void XTabAnalyzer.setHeight(integer height)
Changes the height of the viewer.
Parameter
height
Integer. The height in pixels.
Example
This example retrieves the viewer’s current height. When the current height is fewer than 630 pixels, the example code doubles the viewer’s height.
function doubleHeight( ){
var height = viewer.getHeight( );
if (height < 630){
height = height * 2;
viewer.setHeight(height);
viewer.submit( );
}
}
setIVMode
Syntax
void XTabAnalyzer.setIVMode(boolean ivMode)
Sets IVMode for the viewer. Integrating a Data Analytics viewer with the Interactive Viewer affects the undo/redo feature. When set to true, all changes to the Data Analytics viewer must be committed as one transaction. The Interactive Viewer can undo or redo the entire batch.
Parameter
ivMode
Boolean. Set to true if using IV mode.
Example
This example sets IVMode for the viewer:
function setViewerMode(mode){
viewer.setIVMode(mode);
}
setLeft
Syntax
void XTabAnalyzer.setLeft(integer left)
Sets the position of the viewer’s left margin.
Parameter
left
Integer. The left margin for the viewer in pixels.
Example
This example retrieves the left edge of the viewer and moves the viewer 20 pixels to the right when the margin to the edge of the screen is less than 45 pixels:
function moveLeftMargin( ){
var left = viewer.getLeft( );
if (left < 45){
viewer.setLeft(left + 20);
viewer.submit( );
}
}
setOnClosed
Syntax
void XTabAnalyzer.setOnClosed(function callback)
Sets a callback function to call when a viewer pop‑up closes.
Parameter
callback
Function. The function to call when the pop‑up closes.
Example
This example checks to see if a pop‑up window is active and sets a callback function to trigger when the pop‑up closes:
function setPopupCloser( ){
if(viewer.isActive( )){
viewer.setOnClosed(closerCallbackFunctionName);
}
}
setPageNum
Syntax
void XTabAnalyzer.setPageNum(function pageNum)
Sets the page number.
Parameter
pageNum
Integer. The page number.
Example
This example sets the sets the page number to the first page:
function setPageNumberToFirst( ){
if(viewer.isActive( )){
viewer.setPageNum(1);
}
}
setParameterValues
Syntax
void XTabAnalyzer.setParameterValues(actuate.xtabanalyzer.ParameterValue[ ] parameterValues)
Sets the parameter values.
Parameter
parameterValues
actuate.xtabanalyzer.ParameterValue[ ] or actuate.parameter.ParameterValue[ ]. An array of parameter values.
setPosition
Syntax
void XTabAnalyzer.setPosition(string position)
Sets the CSS position attribute.
Parameter
position
String. The value for the CSS position attribute.
Example
This example changes the type of CSS positioning in use:
function changePosition( ){
var pos = viewer.getPosition( );
if (pos == 'relative') {
viewer.setPosition('absolute');
viewer.submit( );
}
}
setReportletDocumentMode
Syntax
void XTabAnalyzer.setReportletDocumentMode(boolean reportletMode)
Sets whether the viewer displays documents as Reportlets.
Parameter
reportletMode
Boolean. True indicates Reportlet display mode.
setReportName
Syntax
void XTabAnalyzer.setReportName(string reportName, string connectionHandle)
Sets the report file name for the viewer. The file must be a report document file or report design file.
Parameters
reportName
String. The name of the report file.
connectionHandle
String. Optional. The unique identifier generated by iHub for a temporary report.
Example
This example sets the report name to reportfile.rptdocument and reloads the Interactive Crosstabs viewer with its content:
function run( ){
container = document.getElementById("acviewer");
viewer = new actuate.XTabAnalyzer(container);
viewer.setReportName("reportfile.rptdocument");
viewer.submit( );
}
setService
Syntax
void XTabAnalyzer.setService(string iPortalURL, actuate.RequestOptions requestOptions)
Sets the Actuate web application URL. This function can request options for that URL.
Parameters
iPortalURL
String. The URL of the Actuate web application.
requestOptions
actuate.RequestOptions object. Request options for the web application. This parameter is optional.
Example
This example sets the service and request options:
function setServerOptions(URL,options){
viewer.setService(URL,options);
}
setSupportSVG
Syntax
void XTabAnalyzer.setSupportSVG(boolean svgFlag)
Sets a flag indicating whether or not the browser supports SVG.
Parameter
svgFlag
Boolean. Flag indicating SVG support in the browser. This parameter’s value is true when the browser supports SVG and false in all other cases.
Example
This example sets the browser’s level of SVG support:
function setSVG(flag){
viewer.setSupportSVG(flag);
}
setTop
Syntax
void XTabAnalyzer.setTop(integer top)
Sets the top margin for the viewer.
Parameter
top
Integer. The top margin for the viewer in pixels.
Example
This example retrieves the current top margin for the viewer and moves the margin 20 pixels down the screen when the current position of the margin is fewer than 45 pixels from the top of the screen:
function moveTopMargin( ){
var top = viewer.getTop( );
if (top < 45){
top = top + 20;
viewer.setTop(top);
viewer.submit( );
}
}
setUIOptions
Syntax
void XTabAnalyzer.setUIOptions(actuate.xtabanalyzer.uioptions options)
Sets the user interface options enabled for the viewer.
Parameter
options
Actuate.xtabanalyzer.uioptions object. The options object for the viewer.
Example
This example retrieves the user interface options and sets one of the UIOptions values:
function resetUIOptions( ){
var options = viewer.getUIOptions( );
options.enableToolbar(false);
viewer.setUIOptions(options);
}
setWidth
Syntax
void XTabAnalyzer.setWidth(integer width)
Sets the width for the viewer.
Parameter
width
Integer. The width for the viewer in pixels.
Example
This example retrieves the width of the viewer. When the viewer is fewer than 630 pixels wide, the example code doubles the viewer’s width:
function doubleWidth( ){
var width = viewer.getWidth( );
if (width < 630){
viewer.setWidth(width * 2);
viewer.submit( );
}
}
setXTabBookmark
Syntax
void XTabAnalyzer.setXTabBookmark(string bookmark)
Sets the bookmark for a cross tab to render in the viewer.
Parameter
bookmark
String. The bookmark for a cross tab.
Example
This example retrieves the bookmark for the cross tab the viewer is associated with, changes the bookmark, and reloads the bookmark. This functionality enables the use of multiple cross tab elements within a single design.
function changeBookmark( ){
var oldBookMark = viewer.getXTabBookmark( );
viewer.setXTabBookmark("crosstab2");
viewer.submit( );
}
setXTabIid
Syntax
void XTabAnalyzer.setXTabIid(string iid)
Sets the instance ID for viewer rendering. This function is useful in integration with Interactive Viewer, and supports the ability of Interactive Viewer to obtain and use the cross tab instance ID.
Parameter
iid
String. The instance ID.
Example
This example sets the cross tab instance ID:
function setxtabInstance(id){
viewer.setXTablid(id);
}
submit
Syntax
void XTabAnalyzer.submit(function callback, boolean rerun)
Submits requests to the server for the Interactive Crosstabs viewer. This method triggers an AJAX request to submit all pending operations for this object. The server returns a response after processing the pending operations. The results render on the page in the Interactive Crosstabs container. The submit( ) function throws an exception when another submit( ) operation is pending. A CONTENT_CHANGED event fires when the Interactive Crosstabs content changes.
Parameters
callback
Function. Optional. A function called when submit completes. This function receives the current XTabAnalyzer object as an input parameter.
rerun
Boolean. Optional. Indicates whether re-run the report design when it refreshes. Default to true.
Example
This example retrieves the left margin of the viewer and expands the margin. The change does not take effect until submit( ) executes. The submit( ) function calls the function in the submitCallback parameter when submit( ) finishes executing. The callback function contains any processing that must occur after submit( ) finishes. Do not place code after the submit( ) call in the same function because submit( ) is asynchronous.
function moveLeftMargin( ){
var left = viewer.getLeft( );
if (left < 45){
viewer.setLeft(left + 20);
viewer.submit(submitCallback);
}
}