Page 1 of 1
Parameter value override based on dataset return - 2.5.0 Fail
#1
Posted 27 January 2010 - 06:34 AM
I have a report design that worked in 2.3.0 but no longer works in 2.5.0. I have a parameter based on a dataset, and a script in beforeOpen that modifies the dataset results. In 2.3.0 the dependent parameter correctly shows the new result, but in 2.5.0 the dependent parameter shows the dataset results before the change.
The following describes the sample report I created to demonstrate this, using the Classic Models database.
1) Create parameter officeCode as String, TextBox, Required with default value '1'
2) Create data set select_simple as
select city from offices where officecode = ?
Assign parameter param_1 as String direction Input linked to report parameter officeCode
3) Edit the beforeOpen event script for the select_simple dataset as follows:
reportContext.setParameterValue("officeCode","3");
4) Create parameter select_result as String, ComboBox, Dynamic, Required
Using data set select_simple, value column CITY, no default value
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'NYC'
Now take that same report file and run it under 2.5.0
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'San Francisco'
Apparently in 2.5.0 the datasets are being run and dependent objects assigned before the 'beforeOpen' script executes.
As a clarifying note, the actual report in which this situation was observed was using a data set for report display as the dependent object, not a parameter.
Are there workarounds for this? It has been suggested that perhaps I can use the new getSelectionValueList and getDefaultValueList parameter script events to accomplish this. It has also been pointed out to me that relying on dataset evaluation order was never a safe thing to do in 2.3, but that's water under the bridge.
Richard A. Polunsky
Triple Point Technology
Houston, Texas USA
The following describes the sample report I created to demonstrate this, using the Classic Models database.
1) Create parameter officeCode as String, TextBox, Required with default value '1'
2) Create data set select_simple as
select city from offices where officecode = ?
Assign parameter param_1 as String direction Input linked to report parameter officeCode
3) Edit the beforeOpen event script for the select_simple dataset as follows:
reportContext.setParameterValue("officeCode","3");
4) Create parameter select_result as String, ComboBox, Dynamic, Required
Using data set select_simple, value column CITY, no default value
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'NYC'
Now take that same report file and run it under 2.5.0
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'San Francisco'
Apparently in 2.5.0 the datasets are being run and dependent objects assigned before the 'beforeOpen' script executes.
As a clarifying note, the actual report in which this situation was observed was using a data set for report display as the dependent object, not a parameter.
Are there workarounds for this? It has been suggested that perhaps I can use the new getSelectionValueList and getDefaultValueList parameter script events to accomplish this. It has also been pointed out to me that relying on dataset evaluation order was never a safe thing to do in 2.3, but that's water under the bridge.
Richard A. Polunsky
Triple Point Technology
Houston, Texas USA
#3
Posted 10 March 2010 - 06:46 AM
rpolunsky said:
I have a report design that worked in 2.3.0 but no longer works in 2.5.0. I have a parameter based on a dataset, and a script in beforeOpen that modifies the dataset results. In 2.3.0 the dependent parameter correctly shows the new result, but in 2.5.0 the dependent parameter shows the dataset results before the change.
The following describes the sample report I created to demonstrate this, using the Classic Models database.
1) Create parameter officeCode as String, TextBox, Required with default value '1'
2) Create data set select_simple as
select city from offices where officecode = ?
Assign parameter param_1 as String direction Input linked to report parameter officeCode
3) Edit the beforeOpen event script for the select_simple dataset as follows:
reportContext.setParameterValue("officeCode","3");
4) Create parameter select_result as String, ComboBox, Dynamic, Required
Using data set select_simple, value column CITY, no default value
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'NYC'
Now take that same report file and run it under 2.5.0
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'San Francisco'
Apparently in 2.5.0 the datasets are being run and dependent objects assigned before the 'beforeOpen' script executes.
As a clarifying note, the actual report in which this situation was observed was using a data set for report display as the dependent object, not a parameter.
Are there workarounds for this? It has been suggested that perhaps I can use the new getSelectionValueList and getDefaultValueList parameter script events to accomplish this. It has also been pointed out to me that relying on dataset evaluation order was never a safe thing to do in 2.3, but that's water under the bridge.
Richard A. Polunsky
Triple Point Technology
Houston, Texas USA
The following describes the sample report I created to demonstrate this, using the Classic Models database.
1) Create parameter officeCode as String, TextBox, Required with default value '1'
2) Create data set select_simple as
select city from offices where officecode = ?
Assign parameter param_1 as String direction Input linked to report parameter officeCode
3) Edit the beforeOpen event script for the select_simple dataset as follows:
reportContext.setParameterValue("officeCode","3");
4) Create parameter select_result as String, ComboBox, Dynamic, Required
Using data set select_simple, value column CITY, no default value
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'NYC'
Now take that same report file and run it under 2.5.0
Run the report. When the parameter dialog is displayed,
officeCode = '1'
select_result dropdown = 'San Francisco'
Apparently in 2.5.0 the datasets are being run and dependent objects assigned before the 'beforeOpen' script executes.
As a clarifying note, the actual report in which this situation was observed was using a data set for report display as the dependent object, not a parameter.
Are there workarounds for this? It has been suggested that perhaps I can use the new getSelectionValueList and getDefaultValueList parameter script events to accomplish this. It has also been pointed out to me that relying on dataset evaluation order was never a safe thing to do in 2.3, but that's water under the bridge.
Richard A. Polunsky
Triple Point Technology
Houston, Texas USA
modifying query like this
Select city from offices where officecode =
in beforeOpen event of dataset
this can be done
this.queryText = this.queryText.replaceAll("
this will accomplish desired results.
Page 1 of 1




MultiQuote