Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Adding dynamic columns to an OdaDataSet(using a query that returns a differnt number of columns at runtime, we want to be able to add to the OdaDataSet)
Adding dynamic columns to an OdaDataSet [message #743873] Fri, 21 October 2011 19:55 Go to next message
mcastoe  is currently offline mcastoe Friend
Messages: 5
Registered: June 2010
Junior Member
We have a report that is going to essentially produces a crosstab like result. The BIRT crossTab element has some limitations that the customer can't abide so we are trying to get a report where the output table and the underlying OdaDataSet are extended dynamically based on a set of input parameters. The output table bit works perfectly thanks to the many helpful examples. What I've not been able to do is to get the table data bindings to work. I add the data binding in the beforeFactory event. In the beforeOpen on the dataset, I add columnHints for each new column and I try to add the resultSet columns but the resultSet is null.

Any hints or examples of how to go about this? I've tried adding a computedColumn to the dataset but the report errors out saying it has an invalid column binding.

Re: Adding dynamic columns to an OdaDataSet [message #748427 is a reply to message #743873] Mon, 24 October 2011 17:19 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

See the attached example to see how to add the column bindings.


Jason

On 10/21/2011 3:55 PM, mcastoe wrote:
> We have a report that is going to essentially produces a crosstab like
> result. The BIRT crossTab element has some limitations that the customer
> can't abide so we are trying to get a report where the output table and
> the underlying OdaDataSet are extended dynamically based on a set of
> input parameters. The output table bit works perfectly thanks to the
> many helpful examples. What I've not been able to do is to get the table
> data bindings to work. I add the data binding in the beforeFactory
> event. In the beforeOpen on the dataset, I add columnHints for each new
> column and I try to add the resultSet columns but the resultSet is null.
> Any hints or examples of how to go about this? I've tried adding a
> computedColumn to the dataset but the report errors out saying it has an
> invalid column binding.
>
>
Re: Adding dynamic columns to an OdaDataSet [message #753749 is a reply to message #748427] Fri, 28 October 2011 14:56 Go to previous messageGo to next message
mcastoe  is currently offline mcastoe Friend
Messages: 5
Registered: June 2010
Junior Member
Hi Jason,

thank you for your reply. I am using an ODADataSet rather than the scripted data set and I get dependency cycle errors in the dataset at runtime. It is looking like the issue is that the ODADataSet simply will not allow dynamic modification of the columns it provides at runtime. I may have to switch to a scripted dataset as you are using in your example. the problem is that I am not sure how to make the JDBC calls from the dataset. I suppose it would be something like opening the jdbc resultset in the dataset open event and then iterating the resultSet in the onFetch.
Re: Adding dynamic columns to an OdaDataSet [message #753770 is a reply to message #753749] Fri, 28 October 2011 16:50 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

See attached example for jdbc dataset. Notice report already defines
jdbc data source.

Jason

On 10/28/2011 10:56 AM, mcastoe wrote:
> Hi Jason,
>
> thank you for your reply. I am using an ODADataSet rather than the
> scripted data set and I get dependency cycle errors in the dataset at
> runtime. It is looking like the issue is that the ODADataSet simply will
> not allow dynamic modification of the columns it provides at runtime. I
> may have to switch to a scripted dataset as you are using in your
> example. the problem is that I am not sure how to make the JDBC calls
> from the dataset. I suppose it would be something like opening the jdbc
> resultset in the dataset open event and then iterating the resultSet in
> the onFetch.
  • Attachment: NewTable.zip
    (Size: 1.61KB, Downloaded 364 times)
Re: Adding dynamic columns to an OdaDataSet [message #754873 is a reply to message #753770] Fri, 04 November 2011 17:17 Go to previous message
mcastoe  is currently offline mcastoe Friend
Messages: 5
Registered: June 2010
Junior Member
Jason,

thank you for your reply. Using this example I was able to get everything working.
Previous Topic:InputParameters in DataCube Datasets
Next Topic:How to get the projects folder from in a script?
Goto Forum:
  


Current Time: Sat Dec 20 15:22:59 GMT 2014

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

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