diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index fae4a6f0..9052ecc9 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -146,7 +146,8 @@ namespace Volian.Print.Library // The 3 was changed to 2 for the end line & the line below. The blank line below the step gives the blank // line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The // procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8. - float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; + //float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; + float yEndMsg = (!_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null)? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages // also consider if there is a phone list at the bottom of the page, add the amount of space the phone // list requires onto yEndMsg to make it easier to figure out pagination (include an extra line for the @@ -272,7 +273,8 @@ namespace Volian.Print.Library if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild) KeepStepsOnPage = false; if (ySizeIncludingFirst == YSize) KeepStepsOnPage = false; - float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; + //float ySectionEndMsg = !_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1 && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; + float ySectionEndMsg = (!_skipEndMessage && MyItemInfo.IsSection && MyItemInfo.Steps != null && MyItemInfo.Steps.Count == 1) ? GetEndMessageHeight(MyItemInfo.MyDocStyle) : 0; // B2018-068 account for mult-line End Messages if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) { float vpHeight = SixLinesPerInch; @@ -640,6 +642,18 @@ namespace Volian.Print.Library //return 2; throw new Exception("PageBreak Logic Missing, vlnParagraph.cs"); } + // B2018-058 the the end message height accounting for multi-line end messages + private float GetEndMessageHeight(DocStyle docstyle) + { + float EndMsgHeight = 0; + string endmsg = MyItemInfo.MyDocStyle.End.Message ?? ""; + if (endmsg != "") + { + string[] splitOn = { "\\par" }; // B2018-058 account for RTF newlines ( used for V.C. Summer End messages) + EndMsgHeight = (endmsg.Split(splitOn,StringSplitOptions.RemoveEmptyEntries).Length + 1) * SixLinesPerInch; + } + return EndMsgHeight; + } private float GetBottomEndMessageSize(DocStyle docstyle) { float myBottomMsgSpace = 0;