Message "CONTINUES NEXT PAGE" automatically

smgomessmgomes Member
edited November 1, 2013 in DevShare Downloads
Hi,

this tip purpose as controlling the message: "Continued on next page" in documents like Invoice.

In my example I have a DATASET (Name: Lines) which is a collection in Java that don't know how many rows will iterate the document, to better control the message do as follows:

Method : DATASET > Script > open
//get the collection size (number of lines number of lines in the document)
_collectionSize = new Integer(document.getLines().size());reportContext.setGlobalVariable("_collectionSize",_collectionSize);


My table's lines has this DATASET (Lines) as binding:

TableName (ElementName): documentLines



TableLines.png

Method : Table > Script > onPrepare
_breakPage = new Integer(reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("documentLines").getProperty("pageBreakInterval"));
reportContext.setGlobalVariable("_breakPage",_breakPage);


In the last detail row of the table, which indicates the message add the following script at Visibility Property:
var _breakPage = reportContext.getGlobalVariable("_breakPage");
var _collectionSize = reportContext.getGlobalVariable("_collectionSize");
if ( (row["currentLine"] == _breakPage) && (row["currentLine"] < _collectionSize) ){
_breakPage = parseInt(_breakPage)+parseInt(reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("documentLines").getProperty("pageBreakInterval")); reportContext.setGlobalVariable("_breakPage",_breakPage ); 
false;
}else{ true;}


Whatever the value of the Page Break in table, the message will appear automatically!

I hope I helped because I had this problem!

Best Regards,

Sérgio Gomes
www.projectocolibri.com
Sign In or Register to comment.