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.

Wednesday, August 26, 2015

Maximo .. Update database using Birt report

Sometimes database has to be updated after each report run showing that a report  has been run(example like last run date).

In Birt simple way to achieve this is to execute update query in the 'beforeClose' method of dataset.



var myTxn = MXReportTxnProvider.create("maximoDataSource");


var updateSqlText = new String();

updateSqlText = " update poline set enterdate=SYSDATE  where enterdate is null'";

var apextractStmt = myTxn.createStatement();
apextractStmt.setQuery(updateSqlText);

myTxn.save();





---------------------------------------------------------------------------- All the messagesbelow 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.