Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
72:custom_reports_accessing_data_accessing_parameters [2019/02/07 14:07] – created ext-bkkr | 72:custom_reports_accessing_data_accessing_parameters [2019/03/06 19:40] – ext-bkkr | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Accessing Report Parameter through a Data Set Script ====== | ====== Accessing Report Parameter through a Data Set Script ====== | ||
+ | |||
+ | This example shows how to pass a report paramter to a Stages Data Set collection script. | ||
+ | |||
+ | 1. Create a Report with a Stages Data Source and a Data Set | ||
+ | |||
+ | 2. Create the following Data Set result columns: | ||
+ | |||
+ | ^Name^Type| | ||
+ | |debug|String| | ||
+ | |||
+ | 3. Define a two report parameter. | ||
+ | |||
+ | 4. Copy the following Data Set beforeOpen script. | ||
+ | |||
+ | //Notice: The following script retrieves the parameter values and replaces the paramter place holders / | ||
+ | < | ||
+ | parameters = reportContext.getParameterValue(" | ||
+ | var FilterArray = ""; | ||
+ | if (parameters != null) { | ||
+ | if ( typeof parameters.length == ' | ||
+ | | ||
+ | } | ||
+ | else { | ||
+ | for( i=0; i < | ||
+ | if( i == 0 ){ | ||
+ | | ||
+ | } | ||
+ | else{ | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | tmp = this.queryText.replace("/ | ||
+ | this.queryText = tmp; | ||
+ | tmp = this.queryText.replace("/ | ||
+ | *Parameter*/", | ||
+ | this.queryText = tmp; | ||
+ | </ | ||
+ | |||
+ | 5. Copy the data Set script from the example into your Data Set. | ||
+ | |||
+ | < | ||
+ | function debug(str) { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | Paramater_Multiselect = new Array(/ | ||
+ | Parameter = new String("/ | ||
+ | for each (value in Paramater_Multiselect) { | ||
+ | | ||
+ | } | ||
+ | debug(Parameter); | ||
+ | </ | ||
+ | |||
+ | \\ | ||