Good day. I have a XML file that contains element named TextOutput. This elements occurs just once in the XML. It contains a plain text but special about the text is that lines (they are all 80 characters long) are concatenated together without any separators (no line feeds or so). I need to split the text into individual lines and then print 60 lines per page. But I don't know how to achieve this.
What I have done so far using Using Jaspersoft Studio 5.6.2:
- I'v defined the data adapter of type XML document read the entire text
- I'v also defined a dataset that has one field which uses an xPath to get value of element TextOutput from the XML
- I'v created variable textOutput (java.util.Collection) within the report
- I'v created class extending JRDefaultScriptlet
- In method afterDetailEval() I split TextOutput text into individual lines, then I group them by 60 (meaning I concatenated them using "\n" separator) and I set the textOutput resulting List of Strings where each item (String) represents a page.
- I'v placed TextFiled on the form and set it's expression to $V{textOutput}
But It prints the first page only on which more then 60 lines appears.
Please advise. Many thanks. Vojtech