BIRT Exchange Forum: Parameter value override based on dataset return - 2.5.0 Fail - BIRT Exchange Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Parameter value override based on dataset return - 2.5.0 Fail Rate Topic: -----

#1 User is offline   rpolunsky 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 47
  • Joined: 01-February 08

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
0

#2 User is offline   rpolunsky 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 47
  • Joined: 01-February 08

Posted 28 January 2010 - 05:27 PM

I scripted the replacement into the default value for the parameter using the fx dropdown in the edit parameter dialog
0

#3 User is offline   Maninder 

  • Junior Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 25-March 09

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



modifying query like this

Select city from offices where officecode =


in beforeOpen event of dataset


this can be done

this.queryText = this.queryText.replaceAll("", 3 );

this will accomplish desired results.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users