[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: How can I set a CSS class name for a report item?

Chris,

Try to click it anyways. You may also want to supply a css file that is used at design time and for pdf.

With the IDataItemEventHandler you are only going to be able to change specific style properties. If you try it in the beforeFactory you can change the style property for the design instance

reportContext.getDesignHandle().findElement("mydataitem").setProperty("style", "mystylename");

Keep in mind that doing anything in the onPrepare then applies to all instances of the data item. If you have to have the code on the data item, look at adding a highlight rule which allows you to specify a style name based on some expression. So you could add two highlight rules that would act as follows:

If my data value is less than 500 use style one
If my data value is greater than or equal to 500 use style two

These highlight rules can also be applied using script or the IDataItemEventHandler as well.

Jason




Chris wrote:
Hello Jason,

When I try to do that the OK button always stays greyed out.
Any hint on what's wrong here?


About Günters original question:

He implemented a IDataItemEventHandler.
In the "onPrepare" method he has all information he needs to decide which CSS class he wants to set for a given data item.


Is there a way to set the CSS class name?

If it is not possible using an IDataItemEventHandler - is there another way to dynamically set the class name?


Regards, Chris