Troubleshooting
Problem
Fields in BIRT reports do not wrap if there are no spaces to break on.
Cause
There is an issue in BIRT 3.7.1 & 4.2.1 where report text fields will fail to wrap if there are no spaces in the text to break on.
Resolving The Problem
To address this issue, you can build a function into your report that will insert a hard return into the text field every 'n' characters. Place this function in the initialise portion of your report and attach the function to the problem field.
function wraptext(textToWrap) {
var wrappedText = '';
while (textToWrap.length > 0) {
wrappedText += textToWrap.substring(0,80) + '\n';
textToWrap = textToWrap.substring(80);
}
return wrappedText;
}
var assetParam = ''; assetParam = wraptext(params["assetnum"]) |
In this example, the text will wrap text at 80 characters.. you could adjust this by modifying the function.
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
swg21961573