diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 9aea2357..242fe650 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2081,7 +2081,7 @@ namespace VEPROMS.CSLA.Library _MyTab.Text = ""; _MyTab.CleanText = ""; return; - } + } int stepType = (int)(MyContent.Type % 10000); string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint; // rno gets parent tab @@ -2128,7 +2128,13 @@ namespace VEPROMS.CSLA.Library string tbtoken = seqtabs[localPrintLevel % seqtabs.Count].TabToken; // seqstart in 16bit, number/letter tbformat = tbformat.Replace("{seq}", tbtoken); } - + else + // reset the print level if it's not a sequential type. The code was setting printlevel + // to a -1 for equipment lists, and if the step type was changed to a sequential, it kept the + // -1 (the printlevel property calculates the value only if the current value == 0, + // so that when the above code ran to reset the tab, it would crash because the + // printlevel was not recalculated. + PrintLevel = 0; // If token includes 'Wpar', the parent tab prefix's the tab. if (localPrintLevel > 0 && (tbformat.IndexOf("{numericWpar}") > -1 || tbformat.IndexOf("{alphaWpar}") > -1 || tbformat.IndexOf("{ALPHAWpar}") > -1)) {