Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Newbie: Report Group-lookup multiple values(looking up multiple values in Dynamic Text element)
Newbie: Report Group-lookup multiple values [message #689175] Mon, 27 June 2011 04:02 Go to next message
Karl Forsyth is currently offline Karl ForsythFriend
Messages: 9
Registered: June 2011
Junior Member
I am new to BIRT, and need some guidance.

I created a 'Grouped Listing' report in BIRT. The table is bound to a dataset I created from two tables ('Products' and 'Categories') using a Left Outer Join.

In addition to a detail row, I have a group row ("GroupByCategory") that displays two columns:

Column 1: dataSetRow["Products::category"]
Column 2: row["Categories::name"]

This works great, as "Products::category" serves as the key value for "Categories::name".

However, what I really want to do is:

1) split "Products::category" into multiple key values;
2) use those key values to look up multiple "Categories::name" values from the "Categories" table;
3) concatenate all the "Categories::name" values into a single displayed value in Column 2.

For example:

1) Group row ("GroupByCategory") = dataSetRow["Products::category"] = "A:B:C";

2) Build three lookup keys (using Javascript): "A", "A:B", "A:B:C";

3) Look up three "Categories::name" values from the above three look up keys;

4) Concatentate these three "Categories::name" values into a single displayed value


I can do steps 1,2 and 4 in a Dynamic Text element using Javascript, but I don't know how to do step #3.

Any help would be greatly appreciated!


Regards,

Karl Forsyth
Re: Newbie: Report Group-lookup multiple values [message #689442 is a reply to message #689175] Mon, 27 June 2011 16:08 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karl,

Any chance you could build a report we could run with csv data that has
the issue? One to remember if you want to lookup data it generally
requires that the item be bound to a dataset. So for your step three
are these values from an existing dataset?

Jason

On 6/27/2011 12:02 AM, Karl Forsyth wrote:
> I am new to BIRT, and need some guidance.
>
> I created a 'Grouped Listing' report in BIRT. The table is bound to a
> dataset I created from two tables ('Products' and 'Categories') using a
> Left Outer Join.
>
> In addition to a detail row, I have a group row ("GroupByCategory") that
> displays two columns:
>
> Column 1: dataSetRow["Products::category"]
> Column 2: row["Categories::name"]
>
> This works great, as "Products::category" serves as the key value for
> "Categories::name".
>
> However, what I really want to do is:
>
> 1) split "Products::category" into multiple key values;
> 2) use those key values to look up multiple "Categories::name" values
> from the "Categories" table;
> 3) concatenate all the "Categories::name" values into a single displayed
> value in Column 2.
>
> For example:
>
> 1) Group row ("GroupByCategory") = dataSetRow["Products::category"] =
> "A:B:C";
>
> 2) Build three lookup keys (using Javascript): "A", "A:B", "A:B:C";
>
> 3) Look up three "Categories::name" values from the above three look up
> keys;
>
> 4) Concatentate these three "Categories::name" values into a single
> displayed value
>
>
> I can do steps 1,2 and 4 in a Dynamic Text element using Javascript, but
> I don't know how to do step #3.
>
> Any help would be greatly appreciated!
>
>
> Regards,
>
> Karl Forsyth
>
Re: Newbie: Report Group-lookup multiple values [message #690047 is a reply to message #689442] Tue, 28 June 2011 21:25 Go to previous messageGo to next message
Karl Forsyth is currently offline Karl ForsythFriend
Messages: 9
Registered: June 2011
Junior Member
Jason,

Attached is a simple grouped listing design, and two sample csv files, that illustrate what I want to do.

Note that in the second column of the Group Header I wrote some code that mimics what I need to do. I would need it to look like that, but with live lookups for each of the three categories.

I hope this is clear.

Thank you for looking at this!

Best,
Karl Forsyth
Re: Newbie: Report Group-lookup multiple values [message #690057 is a reply to message #690047] Tue, 28 June 2011 21:44 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karl

Can you remove the references to your libraries and point directly at
the csv files and repost the modified report? I can not run your sample.

Jason

On 6/28/2011 5:25 PM, Karl Forsyth wrote:
> Jason,
>
> Attached is a simple grouped listing design, and two sample csv files, that illustrate what I want to do.
>
> Note that in the second column of the Group Header I wrote some code that mimics what I need to do. I would need it to look like that, but with live lookups for each of the three categories.
>
> I hope this is clear.
>
> Thank you for looking at this!
>
> Best,
> Karl Forsyth
Re: Newbie: Report Group-lookup multiple values [message #690152 is a reply to message #690057] Wed, 29 June 2011 04:37 Go to previous messageGo to next message
Karl Forsyth is currently offline Karl ForsythFriend
Messages: 9
Registered: June 2011
Junior Member
Sorry about that. Here is the report design and the csv data files without referencing a library.

Re: The flat file data source - I couldn't figure out the syntax to specify the folder path using a system variable, so that needs to be changed to your path.

Hopefully this will work for you.

Thanks,

Karl Forsyth
Re: Newbie: Report Group-lookup multiple values [message #690439 is a reply to message #690152] Wed, 29 June 2011 14:21 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karl,

I got your report to run. In the expression that you mimic a live
lookup, I assume you want it to lookup the value from another table?

If this is so, just create a dataset that does the lookup with a dataset
parameter (if it is a flat file then do a dataset that looks up all
possible values). Put a data item(or table item) in the header and bind
it to the new dataset. In the binding you can set the dataset parameter
to the value of your outer table GroupCat. If you are using a flat file
which does not support dataset parameters just apply a filter to the new
item and use the outer table's groupcat.

Jason

On 6/29/2011 12:37 AM, Karl Forsyth wrote:
> Sorry about that. Here is the report design and the csv data files without referencing a library.
>
> Re: The flat file data source - I couldn't figure out the syntax to specify the folder path using a system variable, so that needs to be changed to your path.
>
> Hopefully this will work for you.
>
> Thanks,
>
> Karl Forsyth
Re: Newbie: Report Group-lookup multiple values [message #690537 is a reply to message #690439] Wed, 29 June 2011 16:41 Go to previous messageGo to next message
Karl Forsyth is currently offline Karl ForsythFriend
Messages: 9
Registered: June 2011
Junior Member
Jason,

OK, a dataset parameter...I'm afraid I'm being thick here. Please bear with me...

In the sample report Group Header, the value "TestDataSetProd::Cat" is Joined to "TestDataSetCat::Category", and so serves as the lookup key for "TestDataSetCat::Title" (displayed in column 2 of the Group Header).

Here are the key-value relationships:

"TestDataSetProd::Cat" looks up "TestDataSetCat::Title"
"A" looks up "Category 'A' Title"
"A:B" looks up "Category 'B' Title"
"A:B:C" looks up "Category 'C' Title"

At this simple level, it's working.

However, the key value "TestDataSetProd::Cat" can potentially be parsed into multiple keys, depending on the value. For example:

IF "TestDataSetProd::Cat" = "A", then that is the only key value.

IF "TestDataSetProd::Cat" = "A:B", then two key values can be parsed:
1) "A"
2) "A:B"

IF "TestDataSetProd::Cat" = "A:B:C", then three key values can be parsed:
1) "A"
2) "A:B"
3) "A:B:C"

And so, in column 2 of the Group Header, up to three separate lookups would need to occur, which would then be concatenated to build the full value displayed.

The actual report doesn't use a flat file, and so dataset parameters can be used.

But for this sample flat file report, would I create filters on the existing Joined report dataset "TestProdCat"?
Re: Newbie: Report Group-lookup multiple values [message #690559 is a reply to message #690537] Wed, 29 June 2011 17:02 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Maybe I do not understand the whole issue, but when using a dataset
parameter it can be expression but it is only one dataset. You could
always add three report items that executed three fetch operations and
hide the items. In their oncreate method you could store the value in a
js var and then use a text element to display the value of the js var.

onCreate script:
//do not use var keyword
myjsvar = this.getValue();

text element expression
<value-of>myjsvar</value-of>

Jason

On 6/29/2011 12:41 PM, Karl Forsyth wrote:
> Jason,
>
> OK, a dataset parameter...I'm afraid I'm being thick here. Please bear
> with me...
>
> In the sample report Group Header, the value "TestDataSetProd::Cat" is
> Joined to "TestDataSetCat::Category", and so serves as the lookup key
> for "TestDataSetCat::Title" (displayed in column 2 of the Group Header).
>
> Here are the key-value relationships:
>
> "TestDataSetProd::Cat" looks up "TestDataSetCat::Title"
> "A" looks up "Category 'A' Title"
> "A:B" looks up "Category 'B' Title"
> "A:B:C" looks up "Category 'C' Title"
>
> At this simple level, it's working.
>
> However, the key value "TestDataSetProd::Cat" can potentially be parsed
> into multiple keys, depending on the value. For example:
>
> IF "TestDataSetProd::Cat" = "A", then that is the only key value.
>
> IF "TestDataSetProd::Cat" = "A:B", then two key values can be parsed:
> 1) "A"
> 2) "A:B"
>
> IF "TestDataSetProd::Cat" = "A:B:C", then three key values can be parsed:
> 1) "A"
> 2) "A:B"
> 3) "A:B:C"
>
> And so, in column 2 of the Group Header, up to three separate lookups
> would need to occur, which would then be concatenated to build the full
> value displayed.
>
> The actual report doesn't use a flat file, and so dataset parameters can
> be used.
> But for this sample flat file report, would I create filters on the
> existing Joined report dataset "TestProdCat"?
Re: Newbie: Report Group-lookup multiple values [message #691169 is a reply to message #690559] Thu, 30 June 2011 21:32 Go to previous messageGo to next message
Karl Forsyth is currently offline Karl ForsythFriend
Messages: 9
Registered: June 2011
Junior Member
Jason,

I'm realizing that I'm too new to BIRT to know how to implement your suggestions. I need to be walked through the steps.

Are you available for hire by the hour? I'm thinking that I can get this with just an hour or so of more detailed instruction.

Best wishes,

Karl Forsyth
Re: Newbie: Report Group-lookup multiple values [message #691521 is a reply to message #691169] Fri, 01 July 2011 16:09 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karl,

While I am not for hire, I would be glad to spend some time with you on
the phone, skype, or net-meeting to discuss. Send me an email at
jasonweathersby at windstream dot net.

Jason

On 6/30/2011 5:32 PM, Karl Forsyth wrote:
> Jason,
>
> I'm realizing that I'm too new to BIRT to know how to implement your
> suggestions. I need to be walked through the steps.
>
> Are you available for hire by the hour? I'm thinking that I can get this
> with just an hour or so of more detailed instruction.
>
> Best wishes,
>
> Karl Forsyth
Previous Topic:Reports Not working while upgrading from Birt 2.6.1. to Birt 3.7
Next Topic:ONE MORE COLUMN IN CROSS TAB
Goto Forum:
  


Current Time: Fri Apr 26 11:14:55 GMT 2024

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

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

Back to the top