Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Child data set table name needs seeded on Parent table column value(Data Set Dynamic Variable)
Child data set table name needs seeded on Parent table column value [message #985646] Thu, 15 November 2012 15:23 Go to next message
Peter Brown is currently offline Peter BrownFriend
Messages: 7
Registered: March 2012
Junior Member
www.eclipse.org/birt/2005/design" version="3.2.23" id="1"
Eclipse BIRT Designer Version 4.2.1.v201209101448 Build;4.2.1.v20120912-1721

Hello,

Ref:
http://www.eclipse.org/forums/index.php/mv/msg/310373/821631/#msg_821631

The above post I thought answered a main 'can BIRT do this?' question that we needed answered before committing to BIRT. We are now beginning to use BIRT and I realise this issue is still outstanding.

1st dataset is passed table names as report parameter (currently hard coded in Eclipse and being run from Eclipse) e.g. 'ABC','BCD','CDE' etc.

It has a place holder e.g. WHERE mm.Abbr IN (':abbr') in the Query:Query Text. This is replaced by the params table names in the 'beforeOpen' script of the dataset. (this.queryText = this.queryText.replaceAll(':abbr', params["all_abbr"]))

This is working as it should.

2nd dataset needs to have its table name based on the value of mm.Abbr. (I need ABC_Tran) but when use parameter ? (and pass 1st data set column Abbr) I get 'ABC'_Tran - which sql doesn't like.

I try assigning a variable in the detail row for the parent 'onCreate' script - this.getRowData().getColumnValue("Abbr") per http://www.eclipse.org/forums/index.php/mv/msg/334888/851110/#msg_851110. Shows up correctly on the page when outputted BUT passing this variable to the 2nd data set 'beforeOpen' only passes 'ABC' indicating 'beforeOpen' is a one time trigger.

So it looks like I need to assign the 1st dataset column Abbr value to a variable which is updated on each loop. (parameters don't appear to work for the quoting issue and IN syntax). This updated variable then needs to be assigned to the ':abbr' place holder in the 'beforeOpen' / 'onFetch' of the 2nd dataset.

I set 'New Handler on Each Event' (Data Set Properties Advanced) to true on 2nd data set - no change.

I need the 2nd data set query to be created on each row of the 1st data set....

I am going to try creating the query text in Data Set -> Edit -> Property Binding -> Query Text to see if that forces reading query each time.

Any help greatly appreciated as critical to us continuing with BIRT.
Thanks
Re: Child data set table name needs seeded on Parent table column value [message #985758 is a reply to message #985646] Thu, 15 November 2012 23:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I am not certain I understand the whole issue, but it sounds like the inner data set is only firing once, which it does because of cache if nothing changes. In 3.7.2 we introduced a data set cache flag on the data set advanced properties that should make it execute every time if you set the flag to false.
http://www.eclipse.org/birt/phoenix/project/notable4.2.php#jump_11

Jason
Re: Child data set table name needs seeded on Parent table column value - RESOLVED [message #986270 is a reply to message #985758] Mon, 19 November 2012 16:47 Go to previous message
Peter Brown is currently offline Peter BrownFriend
Messages: 7
Registered: March 2012
Junior Member
Thanks Jason - that was it. We tried that but without the right combination obviously. (sorry for the delay)

(For others) - how I got it to work:
By clicking the 1st detail row of the outer set (in the layout) and then 'onCreate' under Script - assign variables here

abbr = this.getRowData().getColumnValue("Abbr");


Click on inner data set - then 'beforeOpen' under Script

this.queryText = this.queryText.replaceAll(':abbr', abbr);


Inner data set - click on 'Advanced' under Properties (layout): 'Needs cache for data-engine: false', 'New handler on each event: false'
Previous Topic:Updating jar Library
Next Topic:Table headers/footers on each page
Goto Forum:
  


Current Time: Sun Dec 21 03:35:04 GMT 2014

Powered by FUDForum. Page generated in 0.05550 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software