Skip to main content



      Home
Home » Archived » BIRT » Change grid cells content dynamically
Change grid cells content dynamically [message #1061668] Mon, 03 June 2013 08:38 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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.

[Updated on: Sat, 08 June 2013 01:38] by 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
Eclipse UserFriend
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
Eclipse UserFriend
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.
Previous Topic:How to switch datasource using javascript?
Next Topic:Birt ODA 4.2.2
Goto Forum:
  


Current Time: Tue Apr 15 00:55:47 EDT 2025

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

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

Back to the top