Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 202333 - Ability to use dynamic styling on highlights
Summary: Ability to use dynamic styling on highlights
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 2.3.0 M6   Edit
Assignee: Zhiqiang Qian CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 183874
Blocks:
  Show dependency tree
 
Reported: 2007-09-05 17:05 EDT by erlich CLA
Modified: 2008-09-05 09:01 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description erlich CLA 2007-09-05 17:05:33 EDT
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
Comment 1 Ivy Li CLA 2007-09-06 03:50:26 EDT
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. 
Comment 2 erlich CLA 2007-09-06 08:58:06 EDT
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..
Comment 3 erlich CLA 2007-09-07 15:47:58 EDT
I can do it from the value but the background of the cell that contains it doesn't get changed..
Comment 4 xingjie he CLA 2007-09-13 01:18:09 EDT
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. 
Comment 5 erlich CLA 2007-09-25 10:24:37 EDT
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??
Comment 6 Zhiqiang Qian CLA 2007-10-10 22:37:34 EDT
This is the request for Crosstab scripting support.
Comment 7 Zhiqiang Qian CLA 2008-01-31 22:03:50 EST
Deferred to M6.
Comment 8 Zhiqiang Qian CLA 2008-03-20 02:02:36 EDT
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"));
}
Comment 9 erlich CLA 2008-03-26 10:13:42 EDT
Thank you very much..
Right now i cannot change version but i'll try it as soon as i can
Comment 10 erlich CLA 2008-08-20 15:48:58 EDT
How do I obtain the cell??
i tried accesing cell in the script but i couldn't.. where should i go to do it??
Comment 11 erlich CLA 2008-09-03 12:30:05 EDT
I cannot do cell.getStyle() where should i do it??
is this doable on the onCreate method??
Comment 12 Zhiqiang Qian CLA 2008-09-03 23:01:23 EDT
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();
}
Comment 13 erlich CLA 2008-09-04 09:23:17 EDT
ohh i didn't know that... i was using the cell's script directly from the cell..
thanks..
Comment 14 erlich CLA 2008-09-04 11:32:35 EDT
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..

Comment 15 Zhiqiang Qian CLA 2008-09-04 22:19:24 EDT
(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.
Comment 16 erlich CLA 2008-09-05 09:01:34 EDT
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 :)