Home » Archived » BIRT » dependant, nested tables
dependant, nested tables [message #902881] |
Mon, 20 August 2012 17:38  |
Eclipse User |
|
|
|
I have two datasources
1. all workitems in the system, grouped by project (data field)
2. all links between workitems, even across groups.
I have 4 data sets
1. all workitems that meet report parameter input
2 & 3. all sources and targets data set (1 each) that lists the
appropriate link end, these are passed the selected
workitems from dataset 1.
4. a list of workitems that are ONLY the other end of the links from the
selected project, when they are in a different project.
this dataset is passed the list of items from links set via a javscript variable
all this works fine.
now, I want to make a report of all items in dataset 1,
AND while doing that, insert the data from dataset 4 ONLY where appropriate
item 9
item 10
item 14
-----linked item 92
-----linked item 105
item 87
item 43
item 197
-----linked item 207
I have three javascript arrays..
1. all the id's from 1
2. all the id's from 2 & 3 combined
3. all the ids of 1 that match 2 & 3
2 & 3 are in the same 'push' order.
in the layout editor I positioned dataset 4 as part of the row presentation of dataset 1. and changed the input binding on this table to a custom function.
(I see that this is wrong.. I need to filter the master set by my subset)
linkedItems[linkedToItems.indexOf(row["WI_ITEMID"])];
this works fine, except.. when the incoming dataset 1 workitem id does not have any linked children.. then this returns 'undefined' (cause indexOf() is -1)..
what I want to have happen is that if the above double lookup fails, do NOT spend any time trying to find database children.. they don't exist.. this birt client is on the other side of a slow phone line, and the wasted lookup takes 20 minutes.
there are only 4 workitems of 200 that have links..
without the nested table the report presents in 5-8 seconds.
[Updated on: Mon, 20 August 2012 17:55] by Moderator
|
|
| | |
Re: dependant, nested tables [message #903066 is a reply to message #903027] |
Tue, 21 August 2012 15:25   |
Eclipse User |
|
|
|
Ok, let me try to explain a little deeper
workitems table, and links table
1. dataset 1 = a list of all objects (workitems) where project_name = 'xyz' (id,uuid, summary), create javascript array with all the UUIDs matching selected records.
(using onfetch javascript function call to update matchingProjectItems array)
2. links table, has type (text), source(uuid), target(uuid)
datasets 2 & 3, process the links table, given the result set from 1. (passed as a joined() javascript array of uuids in the parameter field)
dataset 2 returns type and source, when target is passed in. ("'"+matchingProjectItems.join("','")+"'"), uses javascript onfetch function call to update linkedItems array
dataset 3 returns type and target, when source is passed in. ("'"+matchingProjectItems.join("','")+"'"), uses javascript onfetch function call to update linkedItems Array
this process makes a single list of uuids, which have one of the objects in results set 1 above as one end of the link, AND
the project name is NOT the same as the report parameter project name.
so, the javascript array contains, 3 UUID strings after all the links are processed.
dataset 4 is a list of objects, with a passed in list (joined javascript array of UUIDs from step 2.) "'"+linkedItems.join("','")+"'"
now,
I want to present dataset 1 (outer table), of objects whos project name matches
AND conditionally present those items from dataset 4.
note that dataset 4 has only the UUID NOT included in the set of records in dataset 1.
they have to be looked up indirectly.. unless there is a better way
[Updated on: Tue, 21 August 2012 15:29] by Moderator
|
|
|
Re: dependant, nested tables [message #903077 is a reply to message #903066] |
Tue, 21 August 2012 16:21   |
Eclipse User |
|
|
|
Sam,
Maybe I am missing something but why did you have to use js arrays? why
not used nested tables? Say data set 1 tied to a table 1, where you do
not have to show any of the data values but all the values are already
available to any nested table. If you want to do a skype session let me
know.
Jason
On 8/21/2012 3:25 PM, sam detewiler wrote:
> Ok, let me try to explain a little deeper
> workitems table, and links table
>
> 1. dataset 1 = a list of all objects (workitems) where project_name =
> 'xyz' (id,uuid, summary), create javascript array with all the UUIDs
> matching selected records. (using onfetch javascript function
> call to update matchingProjectItems array)
> 2. links table, has type (text), source(uuid), target(uuid)
> datasets 2 & 3, process the links table, given the result set from 1.
> (passed as a joined() javascript array in the parameter field)
> dataset 2 returns type and source, when target is passed in.
> ("'"+matchingProjectItems.join("','")+"'"), uses javascript onfetch
> function call to update linkedItems array
> dataset 3 returns type and target, when source is passed in.
> ("'"+matchingProjectItems.join("','")+"'"), uses javascript onfetch
> function call to update linkedItems Array this process makes a single
> list of uuids, which have one of the objects in results set 1 above as
> one end of the link, AND the project name is NOT the same as the
> report parameter project name. so, the javascript array contains, 3
> UUID strings after all the links are processed. dataset 4 is a list of
> objects, with a passed in list (joined javascript array of UUIDs from
> step 2.) "'"+linkedItems.join("','")+"'" now,
> I want to present dataset 1 (outer table), of objects whos project name
> matches AND conditionally present those items from dataset 4.
> note that dataset 4 has only the UUID NOT included in the set of
> records in dataset 1.
> they have to be looked up indirectly.. unless there is a better way
|
|
| | | |
Re: dependant, nested tables [message #904032 is a reply to message #903780] |
Mon, 27 August 2012 11:33  |
Eclipse User |
|
|
|
Sam
From a birt filter angle you could use an in filter and apply two
filters, but this will not reduce the impact as the 100000 rows will
still have to be brought back by the data engine to let it filter those
rows.
Jason
On 8/25/2012 5:12 PM, sam detweiler wrote:
> so, I want to try to reduce the impact on the system a little bit.
>
> is there a way to make a dataset filter an OR instead of an AND..
>
> I have the lit of primary records I care about..
> I now want to find the tiny set of secondary records that reference the
> primary
>
> the secondary data set is
>
> type
> source
> target
>
> where source could be the reference to one of the primarys
> or target could be one of the primarys,
> or both could be one of the primarys
>
> so what I want is a single sql stmt, to preload all the results. this
> might end up being a couple hundred records in 100,000 records.
> select * from links where source in list or target in list.
>
> where list is a javascript array joined to a string,
> 'entry1','entry2'...'entryn'
> or the collection of records (all at once) from the search of the
> primary table with the report parameter match. built by sing
> Total.count() to fetch the primary table.
>
|
|
|
Goto Forum:
Current Time: Sat Mar 22 15:38:51 EDT 2025
Powered by FUDForum. Page generated in 0.07142 seconds
|