Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331279

Summary: Scripted Data Set Parameters dont work in Viewer 2.6.1
Product: z_Archived Reporter: Ramesh Chandra <jhamoora2004>
Component: BIRTAssignee: Birt-DataAccess <Birt-DataAccess-inbox>
Status: NEW --- QA Contact: Xiaoying Gu <bluesoldier>
Severity: major    
Priority: P3 CC: bluesoldier
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
ScriptedParameterTest.rptdesign - having Scripted Data Set based report parameters, not dependent on any external data none

Description Ramesh Chandra CLA 2010-11-28 00:31:57 EST
Build Identifier: 20100917-0705

A report parameter which is configured as dynamic and based on a Scripted Data Set does not populate data from the data set in the parameter page.  However, other types of data sets (flat, jdbc) etc. are working well as per expectation.
So, I am not able to build reports that need data as input parameters. 
This is not the same as bug#331032

Reproducible: Always

Steps to Reproduce:
1. Create a new Java Project
2. Create a new report in this java project
3. Create a new Data Source of type "Scripted Data Source", say "SomeDS"
4. Create a new Data Set with Data Source as "SomeDS", say "SomeDSet"
5. Create 2 output columns - id (String), name (String)
6. Create the open method as given below:
	totalRows = 3;
	currentRow = 0;
7. Create the fetch method as follows:
	if(currentRow == totalRows) return false;
	row["id"] = "" + id;
	row["name"] = "name " + id;
	currentRow++;
	return true;
8. Create a new report parameter, "whichId" with the following configuration:
	Name: whichId
	Prompt Text: Select Id
	Data type: String
	Display type: List box
	Selection list values: Dynamic
	Data Set: SomeDSet
	Select column value id: id
	Select display text: name
9. Save the report
10. Run the report
11. In the paramter page the list box is empty, instead of showing 3 values to pick from
Comment 1 Ramesh Chandra CLA 2010-11-28 00:34:13 EST
Created attachment 183989 [details]
ScriptedParameterTest.rptdesign - having Scripted Data Set based report parameters, not dependent on any external data
Comment 2 Xiaoying Gu CLA 2010-11-29 02:53:41 EST
If you preview the dataset, you will see that there is 0 record found. So actually the empty parameter list is correct.
 
But the empty dataset result is because there is an error in the script of data set and exceptions were thrown out. If you check the workspace\.metadata\.plugins\org.eclipse.birt.report.viewer\logs\, you will see the detailed error message.

I think the issue here might be that error dialog should pop up when you preview the dataset.