This would be easy enough to do if you were willing to make GH1 and GH2 the same standard size. This would mean they would have to the maximum height to accommodate the longest note allowed.
To get the page for the text at the end of the PO, you would insert another group footer section GF#1_b and resize so that it corresponds to the size of a page excluding the page header and footer, and then format this section to "new page before" and for "new page after" enter a conditional formula:
not onlastrecord
For the text page for multiple page POs, you would create two formulas:
//{@reset} to be placed in the page header:
whileprintingrecords;
numbervar linecnt := 0;
//{@linecnt} to be placed in the GH#2 section:
whileprintingrecords;
numbervar linecnt := linecnt + 1;
Place this on the report and note the number at the bottom of the page.
Insert a second GH#2_b section that is also the size of the page excluding page header and footer. Then go to the section expert->GH#2_b->suppress->x+2 and enter:
{@linecnt} <> 30 //Use the number from the end of the page as noted
//earlier in place of "30"
Place your text in both the GH#2_b section and the GF#1_b.
You might be able to work with differently sized GH#2 sections if you do the following:
First reformat the comment that grows to a non-proportional font like Courier. Then count how many characters, including spaces, appear in each complete line of the comment before it wraps. Use this number in a formula {@lines}:
-int(-len({table.comment})/25) //substitute the line length for "25"
Then change the linecnt formula to:
//{@linecnt} to be placed in the GH#2 section:
whileprintingrecords;
numbervar linecnt := linecnt + {@lines};
Then for your suppression formula for GH#2_b you would need to use a range, e.g.,
not({@linecnt} in 26 to 30)
You would have to experiment to determine the correct range.
-LB