Saturday, October 24, 2015

How to wrap data attributes in Birt Report

Below function would be useful for wrapping the data present in a field.

if(dataSetRow["description"]!=null){
function wrap(longStr,width){ length = longStr.length; if(length <= width) return longStr; return (longStr.substring(0, width) + "\n" + wrap(longStr.substring(width, length), width)); }wrap( dataSetRow["description"], 15 );
}

in the above function, i am trying to wrap description field to a size of 15.

Only disadvantage of this is that it includes hard stops so after every 15 characters which can be frustrating to a user who uses the report in a excel sheet.

----------------------------------------------------------------------------
All the messages below are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.