diff --git a/PROMS/DataLoader/LoadTreeDB.cs b/PROMS/DataLoader/LoadTreeDB.cs index 3d5e5fca..139b8e04 100644 --- a/PROMS/DataLoader/LoadTreeDB.cs +++ b/PROMS/DataLoader/LoadTreeDB.cs @@ -331,6 +331,8 @@ namespace DataLoader { vb.LoadChildren(vs.GetChildren(vb.ToString())); List lv = vb.Children; + if (vb.Children.Count == 0) + frmMain.AddError("No children found for {0}", vb.Path); foreach (vlnObject vbc in lv) { if (vbc.Path.ToUpper().StartsWith(OnlyThisFolder) || OnlyThisFolder.StartsWith(vbc.Path.ToUpper())) @@ -341,6 +343,7 @@ namespace DataLoader return; frmMain.Status = "Loading " + vbc.Title; MigrateChildren(vbc, vs, dbConn, idc, tnc); + frmMain.ChildrenProcessed++; } } } diff --git a/PROMS/DataLoader/frmLoader.cs b/PROMS/DataLoader/frmLoader.cs index e484ea80..517cbd6a 100644 --- a/PROMS/DataLoader/frmLoader.cs +++ b/PROMS/DataLoader/frmLoader.cs @@ -72,6 +72,12 @@ namespace DataLoader Application.DoEvents(); } } + private int _ChildrenProcessed; + public int ChildrenProcessed + { + get { return _ChildrenProcessed; } + set { _ChildrenProcessed = value; } + } private frmErrors _MyFrmErrors = null; public frmErrors MyFrmErrors { @@ -817,6 +823,7 @@ namespace DataLoader } private void completeToolStripMenuItem_Click(object sender, EventArgs e) { + ChildrenProcessed = 0; ProcessFailed = false; ProcessComplete = true; ProcessTime = DateTime.Now; @@ -824,6 +831,11 @@ namespace DataLoader // Phase 1 - Convert dBase to SQL btnConvert_Click(this, new System.EventArgs()); if (ProcessFailed) return; + if (ChildrenProcessed == 0) + { + MessageBox.Show("No children found to convert. Check vlnControl.xml file. Process complete"); + return; + } mb.Append("dBase Conversion Complete"); Status = "Backing up Phase 1 Data"; Backup("_" + MySettings.Phase1Suffix); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index d8eed54d..5e61cee2 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -1055,7 +1055,9 @@ namespace VEPROMS.CSLA.Library { ItemInfo tmpitm = TranGetSectionItem(itminfo); if (!tmpitm.IsSection) return ""; - return (tmpitm.MyContent.Number); + string str = tmpitm.MyContent.Number; + str = Regex.Replace(str, @"\<[uU]\>", itminfo.MyDocVersion.DocVersionConfig.Unit_Number); + return (str); } private static string TranGetSectionTitle(TransitionBuilder tb, ItemInfo itminfo) { diff --git a/PROMS/Volian.Print.Library/Pagination.cs b/PROMS/Volian.Print.Library/Pagination.cs index ca25cf09..499e62a3 100644 --- a/PROMS/Volian.Print.Library/Pagination.cs +++ b/PROMS/Volian.Print.Library/Pagination.cs @@ -29,13 +29,18 @@ namespace Volian.Print.Library private int Paginate(float yLocation, float yTopMargin, float yBottomMargin) { // Check if paginate on a separate section, if within a section. Top level section pagination happens in PromsPrinter + float yPageSize = yTopMargin - yBottomMargin; + bool ManualPageBreak = false; + float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch; if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination()) + { + ShowPageBreak(1, "Page Break between separate sections", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 1; + } // if the EndForSingle format flag is set to false, then we do not print an End message if the section // is a single column section. bool _skipEndMessage = MyPageHelper.MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle; - float yPageSize = yTopMargin - yBottomMargin; // TODO: This does not account for a long step as the last step that would exceed more than one page and // that has an end message that needs to be accounted for in determining pagination. To do that the last @@ -47,7 +52,6 @@ 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. - bool ManualPageBreak = false; float yEndMsg = !_skipEndMessage && !MyItemInfo.IsSection && MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; // The following code is to fix a pagination issue in SHE. It was decided to not put it into development @@ -60,7 +64,6 @@ namespace Volian.Print.Library //KBR debug: if (yEndsWithBlankLine != 0) Console.WriteLine("*** yEndsWithBlankLine = {0}", yEndsWithBlankLine); //float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? ((2 * SixLinesPerInch) - yEndsWithBlankLine) : 0; - float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch; bool isFirstChild = MyItemInfo.MyPrevious == null; bool nearTheTop = (yWithinMargins < yPageSize) && (yWithinMargins > (yPageSize - 5 * SixLinesPerInch)); // if step is breaking over a number of pages, determine if the current step is the @@ -152,6 +155,7 @@ namespace Volian.Print.Library // if this step contains Cautions or Notes page breaks have to be added for those. if (TopMostChild != this) PageBreakOnStep = true; BuildPageBreakList(yPageSize, yPageSize, KeepStepsOnPage); // Case 1 :Works for ES05 Step 15 SubStep 7 + ShowPageBreak(1, "Page Break on Steps, Cautions or Notes", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); return 1; } @@ -383,6 +387,7 @@ namespace Volian.Print.Library ySpaceOnCurPage -= myBottomMsgSpace; vlnParagraph lastBreak = paraBreak; paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList, paraBreak, yPageSize - (myTopMsgSpace + SixLinesPerInch) - myBottomMsgSpace); + Console.WriteLine("Break at {0}", paraBreak.MyItemInfo.ShortPath); if (paraBreak == null) { _MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'" @@ -406,7 +411,7 @@ namespace Volian.Print.Library { // If the next page break is beyond the next hls/caution/note, use the next // hls/caution/note. - if (PageBreakOnStepList[0].YTop <= paraBreak.YTop) + if (PageBreakOnStepList[0].YTop <= paraBreak.YTop || PageBreakOnStepList[0].YSize - yTop <= ySpaceOnCurPage) { paraBreak = PageBreakOnStepList[0]; PageBreakOnStepList.RemoveAt(0); diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index d2079dca..23257290 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -189,6 +189,7 @@ namespace Volian.Print.Library } private string BuildMSWordPDF(SectionInfo section) { + if (section.PageNumber == 0) section.PageNumber = _MyHelper.CurrentPageNumber; DateTime tStart = DateTime.Now; string MSWordFile = null; if (section.MyContent.ContentEntryCount == 1) diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs b/PROMS/Volian.Print.Library/vlnParagraph.cs index e21f8f7f..6282950c 100644 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs +++ b/PROMS/Volian.Print.Library/vlnParagraph.cs @@ -1303,6 +1303,7 @@ namespace Volian.Print.Library // from the beginning of the step. // Note that yLocation is negative to have items in descending // order so that adding yTop decrements their values. + if(!myList[stepLevel].ContainsKey(yTop - yLocation)) myList[stepLevel].Add(yTop - yLocation, para); } if (myList[stepLevel].Count == 0) @@ -1666,9 +1667,9 @@ namespace Volian.Print.Library float yForCheckoff = yoff; //0; - default checkoff row is same as FIRST line of text // if dropCheckoff is true, then the checkoff is place on the same of row as the LAST line of text bool dropCheckoff = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.DropCheckOff; + VlnFlexGrid myFlexGrid = new VlnFlexGrid(1, 1); if (itemInfo.MyContent.MyGrid != null) { - VlnFlexGrid myFlexGrid = new VlnFlexGrid(1, 1); myFlexGrid.LoadGrid(itemInfo); MyGrid = new vlnTable(myFlexGrid, cb); Height = MyGrid.Height; @@ -1900,9 +1901,9 @@ namespace Volian.Print.Library float yoffadj = 0; if (itemInfo.Tables[0].IsTable) { - VlnFlexGrid fg = new VlnFlexGrid(1, 1); - fg.LoadGrid(itemInfo.Tables[0]); - if (fg.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !fg.TopRowHasBorder()) + //VlnFlexGrid fg = myFlexGrid; + //fg.LoadGrid(itemInfo.Tables[0]); + if (myFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !myFlexGrid.TopRowHasBorder()) yoffadj = -SixLinesPerInch; } diff --git a/PROMS/fmtxml/PlantSpecific_ByrBwd.cs b/PROMS/fmtxml/PlantSpecific_ByrBwd.cs index 232eb50c..9de17c51 100644 --- a/PROMS/fmtxml/PlantSpecific_ByrBwd.cs +++ b/PROMS/fmtxml/PlantSpecific_ByrBwd.cs @@ -50,8 +50,15 @@ namespace fmtxml fmtdata.BoxData[2].TabPos = 265F; fmtdata.BoxData[2].Start = 128F; fmtdata.BoxData[2].End = 420F; - fmtdata.BoxData[2].TxtStart = 132F; - fmtdata.BoxData[2].TxtWidth = 276F; + fmtdata.BoxData[2].TxtStart = 151F; + fmtdata.BoxData[2].TxtWidth = 254F; + fmtdata.BoxData[1].TabPos = 265F; + fmtdata.BoxData[1].Start = 128F; + fmtdata.BoxData[1].End = 420F; + fmtdata.BoxData[1].TxtStart = 151F; + fmtdata.BoxData[1].TxtWidth = 254F; + fmtdata.StepData[6].StepLayoutData.EveryNLines = "-99"; + fmtdata.StepData[7].StepLayoutData.EveryNLines = "-99"; } private void AddEXCLN00fmt(ref FormatData fmtdata) { @@ -74,9 +81,9 @@ namespace fmtxml fmtdata.SectData.StepSectionData.StpSectLayData.WidT = 526F; fmtdata.StepData[2].TabData.RNOIdent = "ERG STEP : "; fmtdata.StepData[3].TabData.RNOIdent = "ERG NOTE : "; - fmtdata.StepData[6].TabData.RNOIdent = "ERG CAUTION: "; + fmtdata.StepData[6].TabData.RNOIdent = "ERG CAUTION : "; fmtdata.StepData[7].TabData.RNOIdent = "ERG NOTE : "; - fmtdata.StepData[9].TabData.RNOIdent = "ERG CAUTION: "; + fmtdata.StepData[9].TabData.RNOIdent = "ERG CAUTION : "; fmtdata.StepData[43].ColOverride = "42"; fmtdata.SectData.StepSectionData.StpSectLayData.UseRNOParentIdent = "True"; fmtdata.SectData.StepSectionData.StpSectLayData.DevNoteOrCautionTabOffset = "42"; @@ -105,6 +112,7 @@ namespace fmtxml dcstyles.DcStyles[0].PageWidth = 580.2F; dcstyles.DcStyles[1].LeftMargin = 48F; dcstyles.DcStyles[1].PageWidth = 579.2F; + dcstyles.DcStyles[1].PageLength = 578F; } private void AddEXEDEVDoc(ref DocStyles dcstyles) {