ttong Posted February 1, 2012 Share Posted February 1, 2012 I am generating a report with contacts that span across different pages. Previously I had isSplitAllowed set to "true". But I don't want a contact to split across different pages. So I set it to "false", the layout of the report looked much better. However it introduced a new problem: In my header, I print the name of the first person and last person of the page. When a contact gets pushed to the next page, it is still processed in the current page. So let's say Bob was supposed to be at the bottom of the first page. But to prevent it from splitting, Bob is now the first element in the second page. However on the header of my first page I still have Alice...Bob (where Alice is the first person of the first page). And on my second page I still have Brenda...Doug (Where Brenda is now the 2nd person of the 2nd page, and Doug last person of 2nd page). My output at the header is [$V{pageFirstItem} + "..." + $V{pageLastItem}]]> where pageFirstItem is: <variable name="pageFirstItem" class="java.lang.String" resetType="Page" calculation="First"> <variableExpression><![CDATA[$F{lastName}]]></variableExpression> <initialValueExpression><![CDATA[$F{lastName}]]></initialValueExpression> </variable> [/code] and pageLastItem is: <variable name="pageLastItem" class="java.lang.String" resetType="Report" calculation="Nothing"> <variableExpression><![CDATA[$F{lastName}]]></variableExpression>[/code] Link to comment Share on other sites More sharing options...
jawwadfarooq1 Posted February 6, 2012 Share Posted February 6, 2012 This is because the last item is first processed and then moved to the next page in this case record of Bob is processed, set pageLastItem variable and then moved to next page. One way is to call the Scriplet class from variable expression of pageLastItem variable and set pageLastItem to second last item instead of last. OR you can try resetType="Page". Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now