Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Iterating over datasets, API documentation and cross tab sub reports
Iterating over datasets, API documentation and cross tab sub reports [message #547716] Mon, 19 July 2010 13:21 Go to next message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Hello,

When reading articles about BIRT or viewing examples, very often when it comes to data sets string like row["xyz"], dataSetRow["xyz"] and others are shown.
Sometimes even some very hidden ones may be seen like some rare "outer" examples..
My first question is:
Is there somewhere a place where all of those data accessing strings are documented?

My second question is how to iterate over a whole data set?
I'm using a JDBC data source and want to calculate some difficult custom columns, what would be easy if I knew how to write a simple for statement that goes over each row within a dataset once.

How can this be done?

My third question is, when using sub reports like described here:
http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1 /subreport/index.php

I want to use a Cross Tab as sub report element. But however the button "Dataset parameter Binding" is not being shown when the sub report element is a Cross Tab. So it is not possible to link values from the outer result set to the inner one. How can I create a sub report using a Cross Tab?

Thanks,
Jan

Re: Iterating over datasets, API documentation and cross tab sub reports [message #549040 is a reply to message #547716] Fri, 23 July 2010 19:23 Go to previous messageGo to next message
Scott Rosenbaum is currently offline Scott RosenbaumFriend
Messages: 425
Registered: July 2009
Senior Member
Jan,

So many questions so little time, I have tried to answer your questions in
line below.

Scott Rosenbaum
Innovent Solutions, BIRT PMC

My first question is:

Is there somewhere a place where all of those data accessing strings are
documented?
>> Not really, I will work on a blog post for Monday on birtworld.blogspot.com.
To answer briefly, you see row["abc"] expressions in two places. On the
DataSet itself you can access the values of a row using the row["field"]
syntax.
On the Table when you access data from the DataSet it uses the expression
dataSetRow["FIELD_NAME"]. Once you have done that you have created a Table
Binding, typically the binding would be named FIELD_NAME. Once a table
binding has been created, you can reference it again as row["FIELD_NAME"].
The difference is that you are not going to the DataSet but to the field
binding. So in the above scenarion if someone was to change the expression
of the first value to be
dataSetRow["FIELD_NAME"] + " " + dataSetRow["OTHER_FIELD"];

Then the row["FIELD_NAME"] would change to have both fields concatenated
together. There are really no limits to how far you can stack up the Table
bindings using row["SFDF"] expressions.

My second question is how to iterate over a whole data set?

I'm using a JDBC data source and want to calculate some difficult custom
columns, what would be easy if I knew how to write a simple for statement
that goes over each row within a dataset once.

How can this be done?

The best way to do what you want to do is to extend the Aggregate Expression
extension point and just create your own Aggregate expression. There are
examples of this on Google Code at:
http://code.google.com/a/eclipselabs.org/p/birt-functions-li b/?redir=1
Look at the aggregate extensions.

If you have your heart set on building your own iterator, the best way I
have found is to add code to the onFetch method to build a Collection of
each row as it is read. Then in the beforeClose method you can either work
with the variables or assign to a global variable.

My third question is, when using sub reports like described here: http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1 /subreport/index.php

I want to use a Cross Tab as sub report element. But however the button "Dataset
parameter Binding" is not being shown when the sub report element is a Cross
Tab. So it is not possible to link values from the outer result set to the
inner one. How can I create a sub report using a Cross Tab?

This is a new one for me. I think the way that the best way to deal with
this would be to use the filter expression on the DataCube. If in the outer
table you assign a value to a global, then you should be able to pick up
that global and filter the data in the DataCube. This should also cause
the DataSet the backs up the DataCube to only be run one time, and the cube
just filters the rows.
Re: Iterating over datasets, API documentation and cross tab sub reports [message #549041 is a reply to message #547716] Fri, 23 July 2010 19:25 Go to previous messageGo to next message
Scott Rosenbaum is currently offline Scott RosenbaumFriend
Messages: 425
Registered: July 2009
Senior Member
Jan,

Also, if you would not mind adding an enhancement request to bugzilla this
would make a nice enhancement.

Scott

> Hello,
>
> When reading articles about BIRT or viewing examples, very often when
> it comes to data sets string like row["xyz"], dataSetRow["xyz"] and
> others are shown.
>
> Sometimes even some very hidden ones may be seen like some rare
> "outer" examples..
>
> My first question is:
>
> Is there somewhere a place where all of those data accessing strings
> are documented?
>
> My second question is how to iterate over a whole data set?
>
> I'm using a JDBC data source and want to calculate some difficult
> custom columns, what would be easy if I knew how to write a simple for
> statement that goes over each row within a dataset once.
>
> How can this be done?
>
> My third question is, when using sub reports like described here:
> http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1 /subreport
> /index.php
>
> I want to use a Cross Tab as sub report element. But however the
> button "Dataset parameter Binding" is not being shown when the sub
> report element is a Cross Tab. So it is not possible to link values
> from the outer result set to the inner one. How can I create a sub
> report using a Cross Tab?
>
> Thanks,
> Jan
Re: Iterating over datasets, API documentation and cross tab sub reports [message #549480 is a reply to message #547716] Mon, 26 July 2010 18:53 Go to previous message
Scott Rosenbaum is currently offline Scott RosenbaumFriend
Messages: 425
Registered: July 2009
Senior Member
Jan,

One last post on the subject. I did do a quick write up on http://birtworld.blogspot.com/2010/07/whats-difference-betwe en.html

If you have any questions, take a look. Any feedback on how we can make
this a bit easier to comprehend would be appreciated.

Scott Rosenbaum
Innovent Solutions, BIRT PMC


> Hello,
>
> When reading articles about BIRT or viewing examples, very often when
> it comes to data sets string like row["xyz"], dataSetRow["xyz"] and
> others are shown.
>
> Sometimes even some very hidden ones may be seen like some rare
> "outer" examples..
>
> My first question is:
>
> Is there somewhere a place where all of those data accessing strings
> are documented?
>
> My second question is how to iterate over a whole data set?
>
> I'm using a JDBC data source and want to calculate some difficult
> custom columns, what would be easy if I knew how to write a simple for
> statement that goes over each row within a dataset once.
>
> How can this be done?
>
> My third question is, when using sub reports like described here:
> http://www.eclipse.org/birt/phoenix/examples/reports/birt2.1 /subreport
> /index.php
>
> I want to use a Cross Tab as sub report element. But however the
> button "Dataset parameter Binding" is not being shown when the sub
> report element is a Cross Tab. So it is not possible to link values
> from the outer result set to the inner one. How can I create a sub
> report using a Cross Tab?
>
> Thanks,
> Jan
Previous Topic:BIRT Chart Performance Issues
Next Topic:BIRT - Tomcat: Running problem (please help, probably very easy!)
Goto Forum:
  


Current Time: Thu Mar 28 08:20:15 GMT 2024

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

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

Back to the top