Search code examples
birt

Birt fill a dataset with javascript


In my database I have a field timestamp like this :

2016/03/23 14:00

2016/03/23 14:01

2016/03/23 14:03

And sometimes I don't have value (here, I don't have 2016/03/23 14:02).

What I want to do to fix this problem :

Store in two parameters the first and the last value (I know how to do this).

Make a dataSet with all values using javascript and those two parameters, in this case :

2016/03/23 14:00

2016/03/23 14:01

2016/03/23 14:02

2016/03/23 14:03

Then I will be able to do a join dataset with those two dataset to fix my problem.

Is it possible with Birt without using a Pojo data source ? I never used this kind of datasource and it seems a little bit complicated for what I need to do...

Thank you and have a good day


Solution

  • What you are looking for is a "Scripted Data Source". If you create a Data Set based on a Scripted Data Source, you can write your fetch method on your own and generate the Data Rows based on your Input Parameters.

    Please search for a tutorial about scripted data sources on your own. This is a whide field.