Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Highlights for one Row in bevorFactory script
Highlights for one Row in bevorFactory script [message #546294] Mon, 12 July 2010 12:11 Go to next message
pigargo is currently offline pigargo
Messages: 14
Registered: May 2010
Junior Member
Hello,

I am using the following script to generate variable highlightrules:

importPackage(Packages.org.eclipse.birt.report.model.api);
importPackage(Packages.org.eclipse.birt.report.model.api.ele ments);
importPackage(Packages.org.eclipse.birt.report.model.api.ele ments.structures);

var th = reportContext.getDesignHandle().findElement("mytable");
var ch = th.getColumns().get(0);
var hr = StructureFactory.createHighlightRule();

for(jj=6; jj<= 20; jj++ ){
hr.setOperator(DesignChoiceConstants.MAP_OPERATOR_EQ);
hr.setTestExpression("row[\"MYSIZE\"]");
hr.setValue1(jj);
hr.setProperty(HighlightRule.FONT_SIZE_MEMBER, jj+"pt");
var ph = ch.getPropertyHandle(StyleHandle.HIGHLIGHT_RULES_PROP);
ph.addItem(hr);
}

If I set the findElement to mytable all will be fine. But in mytable there are 2 rows an I only want to set the highlights for on row. How can I set the findElement to get only my row1? I tried it in many ways but they all end with an error, because my row has no name (it's not possible to set a name for a row) and to send the Element-ID for the findElement function gives also an error.

pigargo
Re: Highlights for one Row in bevorFactory script [message #546364 is a reply to message #546294] Mon, 12 July 2010 14:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

To get a detail row with the table handle you should be able to use:
tabledetail = th.getDetail( ).get( 0 );
If you have more than one detail just increment the get:
tabledetail = th.getDetail( ).get( 1 );

If you set an elementid you can also always use:
reportContext.getDesignHandle().getElementByID(idofitem)

Jason

On 7/12/2010 8:11 AM, pigargo wrote:
> Hello,
>
> I am using the following script to generate variable highlightrules:
>
> importPackage(Packages.org.eclipse.birt.report.model.api);
> importPackage(Packages.org.eclipse.birt.report.model.api.ele ments);
> importPackage(Packages.org.eclipse.birt.report.model.api.ele
> ments.structures);
>
> var th = reportContext.getDesignHandle().findElement("mytable");
> var ch = th.getColumns().get(0);
> var hr = StructureFactory.createHighlightRule();
>
> for(jj=6; jj<= 20; jj++ ){
> hr.setOperator(DesignChoiceConstants.MAP_OPERATOR_EQ);
> hr.setTestExpression("row[\"MYSIZE\"]");
> hr.setValue1(jj);
> hr.setProperty(HighlightRule.FONT_SIZE_MEMBER, jj+"pt");
> var ph = ch.getPropertyHandle(StyleHandle.HIGHLIGHT_RULES_PROP);
> ph.addItem(hr);
> }
>
> If I set the findElement to mytable all will be fine. But in mytable
> there are 2 rows an I only want to set the highlights for on row. How
> can I set the findElement to get only my row1? I tried it in many ways
> but they all end with an error, because my row has no name (it's not
> possible to set a name for a row) and to send the Element-ID for the
> findElement function gives also an error.
>
> pigargo
Re: Highlights for one Row in bevorFactory script [message #546501 is a reply to message #546364] Tue, 13 July 2010 08:15 Go to previous message
pigargo is currently offline pigargo
Messages: 14
Registered: May 2010
Junior Member
Hallo Jason,

this was a greate help to design my report.

Thank you very much.

pigargo
Previous Topic:JDBC Mysql connection
Next Topic: HOW TO CREATE A BIRT REPORT LIBRARY
Goto Forum:
  


Current Time: Sun Sep 21 06:17:37 GMT 2014

Powered by FUDForum. Page generated in 0.01621 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software