Community
Participate
Working Groups
I have a crosstab with highlights and I need them to change the bg color of the current cell.. The problem is that each should have a color defined by a parameter, but the designer only lets me put static colors.. Thanks
You can try to write script for cell, and in the script you can bind the parameter value with the color that u want to set.
But how do i set the color to the cell itself?? I know that i can, in the value of the cell, change the bg color, but it doesn't change the color of the cell itself.. What i mean is, if i do it, the bg color of the value changes, but you can see the cell's bg color like a border for the cell..
I can do it from the value but the background of the cell that contains it doesn't get changed..
For this issue, because you want to set bgcolor dynamicly, so you should use script for help. But now unfortunatly extended item don't support script, when engine meets script in extended item they do nothing, and crosstab itself also don't support script. So your issue maybe need more time to fix. Thanks for your understand.
Ok, thanks.. But i know how to do it from the script on the value cell.. the problem is that the cell that contains it (Extended item¿?) doesnt chage it's bgcolor so it remains like a border that sometimes is shown and sometimes not and looks like broken .. is there anyway to adjust the extended item so it just shows the cell value??
This is the request for Crosstab scripting support.
Deferred to M6.
Fixed. You can now write script for crosstab cell like this: if (cell.getCellID() == 100 && reportContext.evaluate("data['measure']") > 1000) { cell.getStyle().setBackgroundColor(reportContext.getParameter("p1")); }
Thank you very much.. Right now i cannot change version but i'll try it as soon as i can
How do I obtain the cell?? i tried accesing cell in the script but i couldn't.. where should i go to do it??
I cannot do cell.getStyle() where should i do it?? is this doable on the onCreate method??
Are you using BIRT 2.3? Select a Crosstab and goto Script tab, you can choose onCreate->onCreateCell, then you can type script code like this: function onCreateCell( cellInst, reportContext ) { cellInst.getStyle().getBackgroundColor(); }
ohh i didn't know that... i was using the cell's script directly from the cell.. thanks..
Is there anyway to know which kind of header the cell is? The crosstab is like: A B C D x1 y1 E x2 y2 F D x3 y3 E x4 y4 And i've to so something with the D and E cells.. so maybe something like dimension name, or dimension level or something like that may help..
(In reply to comment #14) > Is there anyway to know which kind of header the cell is? > The crosstab is like: > > A B > C > D x1 y1 > E x2 y2 > F > D x3 y3 > E x4 y4 > > And i've to so something with the D and E cells.. so maybe something like > dimension name, or dimension level or something like that may help.. > You can use cellInst.getCellID() to distinguish the cells, the cell id is actually a element id, normally you can select the cell and find it from Property Editor in General Page.
OK, thanks, it worked :) Anyway.. something like dimension name or level, or if it's row header or column header.. would be good... just a suggestion anyway :)