Jump to content

BIRT Developer Center Download


Photo
- - - - -

Intercepting query result set in javascript


  • Please log in to reply
1 reply to this topic

#1 Kushagra Kapoor

Kushagra Kapoor

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 20 November 2014 - 04:08 AM

Hi Guys,

I am very new to BIRT. Went through few examples in which while building a report javascript uses Java's pojo object.

My query is somewat different. I have created a jdbc data set in which I have written my query. Now I am having a table where I am using data from this jdbc data set to populate the table.

Now what I want is that, the data that is coming out of this query must come to javascript first for manipulation and then after manipulation of data I will display it in table.

I am not getting how to intercept the data coming from query in the javascript and manipulate it and then populate this manipulated data.

Do I need to make a new scripted data set? If yes how do I get the query result in this data set for manipulation?

 

Scenario:(This is what I am getting as query result) (All the 3 rows are part of table only, I mean even total is also a part of result set, it has not been computed separately by adding the data of first two rows)

                Cost

Abc           5

Xyz            10

Total         15

 

Desired:(This is what I want after manipulation)

                Cost

Abc          33.33%((5/15)*100)

Xyz           66.66%((10/15)*100)

Total        15

 

If this can be done without intercepting data into javascript please suggest.

Also tell how to intercept query data into javascript as I have other scenarios where I can use this concept.

 

Thanks in advance



#2 Kushagra Kapoor

Kushagra Kapoor

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 20 November 2014 - 08:56 PM

Hey Guys,

 

Please suggest some solution. I am kinda stuck in this & its urgent also