Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » BIRT Scripted data source(How to handle nested if conditions in scripted data source)
BIRT Scripted data source [message #1058480] Tue, 14 May 2013 06:36 Go to next message
Hemanth reddy is currently offline Hemanth reddy
Messages: 1
Registered: May 2013
Junior Member
I am confusing about the return statements with if conditions. Say if i have three nested if conditions and if i want to loop through the third if condition till the condition satisifies, what should i do?
If i put return true in third if statements, its going to untermination status(infinite loop).

Given below the example:
if(size1<pol.size()){		// pol block
	ins = pol.get(size1);
		if(size2<ins.size()){ // ins block
		ct = ins.get(size2);
			if(size3<ct.size()){	// ct block
			acce = ct.get(size3);
			row["one"] = acce.firstVal();
			row["two"] = acce.secondVal();
			size3++;
			return true;
			}	// ct block
			size2++;
			return true;
		}						// ins block
		size1++;
			return true;
	}				// pol block
	return false;


My ct block is executed once and going back to pol block and started execution again. How to get rid of this problem?

Does any body have an idea on how to code nested if conditions logic in scripted data source.
Re: BIRT Scripted data source [message #1058774 is a reply to message #1058480] Tue, 14 May 2013 22:48 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1560
Registered: July 2009
Senior Member

You might try doing this in your open method and storing the values into arrays and then stepping through the arrays in your fetch method assigning the values to the rows.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:I use birt 2.3.2 which Tribix xls emitter version should I use?
Next Topic:getting row count of table/dataset
Goto Forum:
  


Current Time: Thu Aug 28 05:22:22 EDT 2014

Powered by FUDForum. Page generated in 0.02031 seconds