Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Change grid cells content dynamically
Change grid cells content dynamically [message #1061668] Mon, 03 June 2013 08:38 Go to next message
Anda Popovici is currently offline Anda Popovici
Messages: 2
Registered: June 2013
Junior Member
Hello,

I am working on an already created BIRT report.

The report contains 10 charts maximum, but they can be fewer if no data exists for some of them.

The page is divided in 4 grids with 1 row and 3 cells each. Each cell contains a chart. The charts are meters.

So the component hierarchy is the following:

Body
 |
  -- Grid
       |
        ---Row
            |
            --- Cell
                 |
                 --- Chart
            --- Cell
                  |
                  --- Chart  
            --- Cell
                  |
                  --- Chart
   -- Grid
        |
        ---Row
            |
            --- Cell
            --- Cell
            --- Cell

...etc.

In the onRender event for each chart, the ranges are set dynamically from data etc.

So normally the chart display looks like this:

1 2 3
4 5 6
7 8 9
10

But, if some charts are not displayed, for example only 8 appear, it looks like this:

1 2 3
4 5
6 7 8

The problem is the requirements are that if some charts are missing, the line should be completed with the ones below, so the configuration above should look like this:

1 2 3
4 5 6
7 8

I do not know how to achieve this, do you have some suggestions how to fill the grid cells dynamically?

I am using BIRT 2.5.2
Re: Change grid cells content dynamically [message #1062487 is a reply to message #1061668] Sat, 08 June 2013 01:13 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1560
Registered: July 2009
Senior Member

Take a look at this report. Each chart is named in the property editor to be able to grab the chart handle in the beforeFactory. The parameter values are checked and the appropriate charts are either moved or dropped from the design. Hope this helps.



Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.

[Updated on: Sat, 08 June 2013 01:38]

Report message to a moderator

Re: Change grid cells content dynamically [message #1063482 is a reply to message #1062487] Thu, 13 June 2013 05:36 Go to previous messageGo to next message
Anda Popovici is currently offline Anda Popovici
Messages: 2
Registered: June 2013
Junior Member
I tried it, moving the charts totally works! One problem is I have to move them based on some dataset values.

As I see, the beforeFactory method is called before the fetch event of the dataset.

Could you suggest another place where I could put the code which moves the charts? Sometime after having the data.

Thank you!
Re: Change grid cells content dynamically [message #1064383 is a reply to message #1063482] Wed, 19 June 2013 00:41 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1560
Registered: July 2009
Senior Member

Take a look at this post from the devShare:

BIRT Exchange DevShare - Data Engine API Example

It'll show you how you can execute your dataSet early enough to check your values to make the appropriate moves. Hope this helps.


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:How to switch datasource using javascript?
Next Topic:Birt ODA 4.2.2
Goto Forum:
  


Current Time: Wed Aug 27 15:24:02 EDT 2014

Powered by FUDForum. Page generated in 0.05966 seconds