开发者

How to set a right BORDER after a column in BIRT

I am adding a new column with the following script, however, the column is coming without a border on the right hand side.

How can I set a BLACK border on the right hand side?

var mytable = reportContext.getDesignHandle().findElement(tableName);
var colbinds = mytable.getColumnBindings( );
var cs1 = StructureFactory.createComputedColumn( );


cs1.setName("Q2");
cs1.setExpression( "dataSetRow[\"Q2\"]" );
colbinds.addItem( cs1 );

//second parameter is before(-1) or after(1)
mytable.insertColumn(2,1);

//get header and add label
var myheader = mytable.getHeader( ).get( 0 );
tcel开发者_C百科l = myheader.getCells( ).get( 2 );
var mylabel = elementFactory.newLabel( null );
mylabel.setText( "Number of Responses (2010 Sites)" );//$NON-NLS-1$
tcell.getContent( ).add( mylabel );
//tcell.getStyle().borderRightColor = "Black"?

//get first detail row
mydetail =  mytable.getDetail( ).get( 0 );
//get first column and add detail data item
var tcell = mydetail.getCells( ).get( 2 );
var mydata = elementFactory.newDataItem( null );
mydata.setResultSetColumn( "Q2");
tcell.getContent( ).add( mydata );
//tcell.getStyle().borderRightColor = "Black"?


You should set style also:

tcell.getStyle().borderRightColor = "Black";
tcell.getStyle().borderRightStyle = "solid";

and optionally:

tcell.getStyle().borderRightWidth = "1pt";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜