Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Change grid cells content dynamically
Change grid cells content dynamically [message #1061668] Mon, 03 June 2013 12:38 Go to next message
Anda Popovici is currently offline Anda PopoviciFriend
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 05:13 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
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

Developer Evangelist, Silanis

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

Report message to a moderator

Re: Change grid cells content dynamically [message #1063482 is a reply to message #1062487] Thu, 13 June 2013 09:36 Go to previous messageGo to next message
Anda Popovici is currently offline Anda PopoviciFriend
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 04:41 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
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

Developer Evangelist, Silanis
Previous Topic:How to switch datasource using javascript?
Next Topic:Birt ODA 4.2.2
Goto Forum:
  


Current Time: Fri Apr 19 21:49:22 GMT 2024

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

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

Back to the top