[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: Report Design: Changing CellHandle Color Property Dynamically

Shellie,

Do you have to create the report using the de api? You can set the cell color using a highlight rule or using an onCreate script.

If you have to use the de api, try backgroundColor instead of color

Jason

shellie wrote:
I'm creating a report with a XML datasource. The XML has <value> and <valuecolor> elements. I'm trying to dynamically set the "value" elements cell color to the value of the dataSetRow[\"valuecolor\]". I'm not having much luck. Each row is being printed out, but I don't know the syntax to add the dynamic color instead of the hard-coded "red" value.
Any ideas? Thanks



cs3 = StructureFactory.createComputedColumn( );

cs3.setName("Node");
cs3.setExpression("dataSetRow[\"value\"]");//$NON-NLS-1$
computedSet.addItem( cs3 );

RowHandle detail3 = (RowHandle) table.getDetail( ).get( 0 );
tcell = (CellHandle) detail3.getCells( ).get( 2 );
tcell.setStringProperty("color", "red"); DataItemHandle data3 = elementFactory.newDataItem( null );
data3.setResultSetColumn( cs3.getName( ) );
tcell.getContent( ).add( data3 );