InetSoft Product Instructions: Setting the onClick Range

For a Table, the onClick range specifies the range of cells for which the onClick script is active. To set the onClick range for an element, right-click the element, and select 'Script' from the context menu. In the Script Editor, select the onClick Range tab. The options for the onClick range are as follows:

BI Demo
Register
#1 Ranking: Read how InetSoft was rated #1 for user adoption in G2's user survey-based index Read More

  • All rows
  • All columns
  • Specific column
  • Header row
  • Trailer row
  • Header column
  • Trailer column

It is very common to pass the value in the clicked cell as a parameter in the hyperlink. For example, the user clicks a state name in the 'State' column, and you want to pass this clicked value to the drill-down report. To obtain the clicked value, first find the row and column indices of the cell by using the event.getRow() and event.getColumn() functions.

 var rowIx = event.getRow();
 var colIx = event.getColumn(); 

Then use these indices with the Table's table property to obtain the data value.

showReplet("customers",[["state",table[rowIx][colIx]]]);

onInit Handler

A report's onInit script is executed only once, before the report is processed. Because all parameter prompting and automatic query execution occurs after the onInit script executes, onInit script is ideal for one-time initialization tasks. The typical usages are as follows:

• Defining report parameters. Because all other scripts execute after parameter prompting, parameter definitions can only be changed from the onInit script.

• Defining report parameter default values. You can manually run a query to supply the default values. (See Running a Query for details.)

Note: A variable declared in onInit script will have global scope. To declare a local variable with the same name elsewhere, use the keyword 'var' in the declaration to remove ambiguity.

• Creating session-level variables. For example, you can use the onInit script to perform all one-time calculations, then store the results in global variables so that you can access them from other scripts.
Previous: Report Handlers