diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 37335725..d4065b4c 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -1579,8 +1579,17 @@ namespace Volian.Print.Library if ((-yLocation + yStart) >= yLowerLimit && !myPara.HasSecondRNOThatWillFit(yStart, yLowerLimit, yUpperLimit ,myList, stepLevel)) // Only if it is more than the lower limit // B2020-013 if it has a second RNO see if it will fit - Callaway OTO-AC-00002 step 2 return myPara; // B2019-103, B2019-114 Break at a step if the step will fit on a page by itself and it will - // not fit in the current pagee - if (StepWillFitOnBlankPageButNotOnCurrentPage(myPara, yLocation, yStart, fullPage)) + // not fit in the current page + float yAdjustLastSubStep = 0; + if ((myPara.MyItemInfo.ActiveParent as ItemInfo).IsHigh && myPara.MyItemInfo.NextItem == null) + { + // B2020-059 Last Substep will fit on page by itself - add the bottom continue message length to the fullpage length. + // fullpage is passed in FindPageBreak() with the bottom continue message length subtracted from the full page length. + // if this is the last sub-step of the HLS then we will not need a continue message, thus we include fullpage by th length of the bottom continue message. + yAdjustLastSubStep = myBottomMsgSpace; + _MyLog.WarnFormat("Last Substep will fit on page by itself {0}", myPara.MyItemInfo.ShortPath); // add information in the error log + } + if (StepWillFitOnBlankPageButNotOnCurrentPage(myPara, yLocation, yStart, fullPage + yAdjustLastSubStep)) if (myPara != lastBreak) return myPara; // If this item will not fit on the current page, put a page break