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 00:02  |
Eclipse User |
|
|
|
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 12:08   |
Eclipse User |
|
|
|
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 #690537 is a reply to message #690439] |
Wed, 29 June 2011 12:41   |
Eclipse User |
|
|
|
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 13:02   |
Eclipse User |
|
|
|
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 #691521 is a reply to message #691169] |
Fri, 01 July 2011 12:09  |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Thu Jul 10 04:33:48 EDT 2025
Powered by FUDForum. Page generated in 1.42944 seconds
|