Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRun Time Element Formatting
https://www.eclipse.org/forums/index.php/mv/msg/233986/713515/#msg_713515
I am a newbie to BIRT and I am just getting in touch with the power of scripting..
According to explanations provided by Jason Weathersby (thanks a lot), i have been able to include the following script in the BeforeFactory event of the report:
As a result, a header of labels are created successfully depending on the number of columns i pass in the parameter.
The question here is how to set styles to the labels newly created. After digging in the forum, the closest i could come up with was a code like:
Unfortunately, my labels do not have names and i am not so familiar with the methods of label objects. Is there any where i could get some documentation or recommendations about how to change these objects in run-time?
Any help would be greatly welcomed...
Thanking you in advance,
Karvesh
]]>karvesh ghunsam2011-08-08T14:56:41-00:00Re: Run Time Element Formatting
https://www.eclipse.org/forums/index.php/mv/msg/233986/713661/#msg_713661
label.setStyleName("highlight-orange");
Just do this right after you create the label.
Jason
On 8/8/2011 10:56 AM, karvesh wrote:
> Dear All,
>
> I am a newbie to BIRT and I am just getting in touch with the power of
> scripting..
>
> According to explanations provided by Jason Weathersby (thanks a lot), i
> have been able to include the following script in the BeforeFactory
> event of the report:
>
> [i]tcell = header.getCells( ).get( i );
> label = elementFactory.newLabel( null );
> label.setText(columnHeaderArray);//$NON-NLS-1$
> tcell.getContent( ).add( label );
>
> As a result, a header of labels are created successfully depending on
> the number of columns i pass in the parameter. The question here is how
> to set styles to the labels newly created. After digging in the forum,
> the closest i could come up with was a code like:
>
> reportContext.getDesignHandle().findelement("mylabel").setstyleName("highlight-orange");
>
>
> Unfortunately, my labels do not have names and i am not so familiar with
> the methods of label objects. Is there any where i could get some
> documentation or recommendations about how to change these objects in
> run-time?
>
> Any help would be greatly welcomed...
>
> Thanking you in advance,
> Karvesh
>]]>Jason Weathersby2011-08-08T18:39:41-00:00Re: Run Time Element Formatting
https://www.eclipse.org/forums/index.php/mv/msg/233986/713771/#msg_713771
Thanks a lot
Its working all fine