diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 92c278ac..a2e265b6 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2502,7 +2502,7 @@ namespace VEPROMS.CSLA.Library { string cltext = null; int stepType = (int)(MyContent.Type % 10000); - string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint; + string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint == "" ? this.MyParent.FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint; string tbformate = null; // need this for background documents, to generate tab for editing. if (IsParagraph && !IsSequential) { diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index 64fad3d3..ca25cf09 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -461,7 +461,8 @@ namespace Volian.Print.Library && myParent.ChildrenRight[0].YSize <= fullPage && myParent.ChildrenRight[0].YSize > spaceOnPage) { //_MyLog.WarnFormat("\r\nMyParentBreak {0},{1},{2},{3},{4}", myParent, myParent.YSize, yUpperLimit, myParent.ChildrenRight[0].YSize, spaceOnPage); - return myParent; + if(myParent != lastBreak) + return myParent; } // The top of this step will fit onto page (-yLocation < yWithinMargins) float wcnChkLstBorder = myPara.MyItemInfo.MyHLS != null && myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate && @@ -478,11 +479,13 @@ namespace Volian.Print.Library //if (myList[stepLevel][yLocation].MyItemInfo.ItemID == 4312) Console.WriteLine("rno"); // The top of this step is more than 1/2 way down the page if ((-yLocation + yStart) >= yLowerLimit) - return myPara; + if (myPara != lastBreak) + return myPara; // If this item will not fit on the current page, put a page break if (myPara.YBottom - myPara.YTop > (yUpperLimit - (-yLocation + yStart))) - return myPara; + if (myPara != lastBreak) + return myPara; // if is a caution or note & parent is a substep and entire substep doesn't fit, break. if ((myPara.MyItemInfo.IsNote || myPara.MyItemInfo.IsCaution) && !myPara.MyParent.MyItemInfo.IsHigh && diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index 9e22e098..76ea5778 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1340,6 +1340,7 @@ namespace Volian.Print.Library } public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent) { + if (itemInfo.ItemID == 70717) Console.WriteLine("jcb"); if (itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj != null) _MyBoxLeftAdj = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj); ShowSectionTitles = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || itemInfo.MyDocStyle.ShowSectionTitles; @@ -1904,17 +1905,52 @@ namespace Volian.Print.Library SectionConfig sc = itemInfo.MyConfig as SectionConfig; if (sc != null && sc.SubSection_Edit != "Y") printsteps = false; } + bool rnoBefore = false; + bool rnoAfter = false; + if (rnoLevel >= maxRNO && itemInfo.RNOs != null && + !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfCreekBackgroundFormat && + !itemInfo.RNOs[0].FormatStepData.InPageList) + { + if ((itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString ?? "") != "" || + (itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString ?? "") != "") + rnoBefore = true; + else + rnoAfter = true; + } + if (rnoBefore) + { + if ((itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString ?? "") != "") + { + string tmpSepStr = itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString; + float tmpSepLen = itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString.Length; + float xsep = MyHighLevelParagraph.PartsLeft.Count > 0 ? MyHighLevelParagraph.PartsLeft[0].XOffset : MyHighLevelParagraph.XOffset; + vlnRNOSeparator mySep = new vlnRNOSeparator(this, cb, tmpSepStr, xsep, yoff, itemInfo.ActiveFormat, false); + PartsBelow.Add(mySep); + yoff += mySep.Height;// +SixLinesPerInch; + } + yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, MyTab.XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); + if ((itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString ?? "") != "") + { + string tmpSepStr = itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString; + float tmpSepLen = itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString.Length; + float xsep = MyHighLevelParagraph.PartsLeft.Count > 0 ? MyHighLevelParagraph.PartsLeft[0].XOffset : MyHighLevelParagraph.XOffset; + vlnRNOSeparator mySep = new vlnRNOSeparator(this, cb, tmpSepStr, xsep, yoff, itemInfo.ActiveFormat, false); + PartsBelow.Add(mySep); + yoff += mySep.Height;// +SixLinesPerInch; + } + } if (itemInfo.Steps != null && printsteps) { if (itemInfo.FormatStepData == null || itemInfo.FormatStepData.Type != "TitleWithTextRight") - yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); + if(rnoBefore) + yoff = ChildrenBelow.Add(cb, itemInfo.Steps, MyTab.XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); + else + yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); } if (itemInfo.Sections != null) yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); if (itemInfo.Procedures != null) yoff = ChildrenBelow.Add(cb, itemInfo.Procedures, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); // Don't add the RNO to print if doing backgrounds. That piece of data is part of the pagelist item. - if (rnoLevel >= maxRNO && itemInfo.RNOs != null && - !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfCreekBackgroundFormat && - !itemInfo.RNOs[0].FormatStepData.InPageList) + if (rnoAfter) yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); yoff = Math.Max(yoff, yOffRight); // TODO - use RNOSepAfterAER flag too: @@ -2674,10 +2710,8 @@ namespace Volian.Print.Library } return; } - int typ = ((int)itemInfo.MyContent.Type) % 10000; - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - float? colOvrd = formatInfo.PlantFormat.FormatData.StepDataList[typ].ColOverride; - + int? bxIndx = itemInfo.FormatStepData.StepLayoutData.STBoxindex; + float? colOvrd = itemInfo.FormatStepData.ColOverride; if (IsBackgroundStep()) { if (myTab != null) myTab.XOffset = XOffset; @@ -2852,6 +2886,12 @@ namespace Volian.Print.Library myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); Width = MyParent.Width - myTab.Width; } + //else if ((itemInfo.FormatStepData.ColOverride ?? 0) > 0) + //{ + // XOffset = (float)itemInfo.FormatStepData.ColOverride; + // MyTab.XOffset = XOffset; + // return; + //} else // if no left justify, right align the tab { XOffset += tabWidth - (myTab == null ? 0 : myTab.TabAlign);