BIRT Exchange Forum: Line Break in LabelHandle text used in CellHandle - BIRT Exchange Forum

Jump to content


 

No Latest Open Poll.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Line Break in LabelHandle text used in CellHandle How to specify line break Rate Topic: -----

#1 User is offline   femibyte Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 36
  • Joined: 26-June 12


Posted 05 July 2012 - 07:44 AM

Hi folks, can someone tell me how I can specify a line break in a Label item that I'm using as a column header in a Table ?

For example, if the header is :
Jun 2011

I'd like it to show up as

Jun 
2011


in the header column.

The header column code looks like this:

LabelHandle label = elementFactory.newLabel( (String)reportCols.get(i) );	
		label.setText(reportCol);
		label.setWidth(columnWidth);
		CellHandle cell = (CellHandle) tblHdrRow1.getCells().get(i);
		cell.getContent().add(label);	


Thanks for your help in advance.
0

#2 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 13105
  • Joined: 16-May 08


Posted 06 July 2012 - 06:29 AM

Try something like:

label.setText(reportCol.replace(" ","\n");
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

#3 User is offline   femibyte Icon

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 36
  • Joined: 26-June 12


Posted 06 July 2012 - 11:16 AM

Thanks a lot. That worked.
0

#4 User is offline   mwilliams Icon

  • BIRT Guru
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 13105
  • Joined: 16-May 08


Posted 06 July 2012 - 11:27 AM

You're welcome!
Regards,

Michael

Twitter
Facebook
Blog
Yahoo: mwilliams_actuate@yahoo.com
Google: mwilliams.actuate@gmail.com
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users