diff --git a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs index b989e1c0..c3f51103 100644 --- a/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs +++ b/PROMS/VEPROMS User Interface/frmPDFStatusForm.cs @@ -131,7 +131,13 @@ namespace VEPROMS this.Close(); return; } - if (!CancelStop) PromsPrinter.ReportTransPageNumProblems(); + if (!CancelStop) + { + if (PromsPrinter.ReportTransPageNumProblems() == DialogResult.Yes && MyPromsPrinter.BeforePageNumberPdf != null) + { + System.Diagnostics.Process.Start(MyPromsPrinter.BeforePageNumberPdf); + } + } DateTime tEnd = DateTime.Now; MyStatus = _PdfFile + " created."; MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds)); diff --git a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs index 3fff8b3d..417ac638 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs @@ -197,6 +197,11 @@ namespace VEPROMS.CSLA.Library //stepLookup = false; // 8/2 change for inheritance if (xmlNode == null) return null;// No path to match string xPath = Path(xmlNode);// Build xPath from xmlNode + if (xmlNode.Name == "TransTypes") + { + string TransIndex = xmlNode.Attributes["Index"].Value; + xPath = System.Text.RegularExpressions.Regex.Replace(xPath, @"\[[0-9]*\]$", @"[@Index='" + TransIndex + @"']"); + } vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument - This also ties it to a FormatInfo object while(fd.MyFormat.MyIParent != null) { diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index 0d9f579b..520a792d 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -165,15 +165,19 @@ namespace Volian.Print.Library { _TransPageNumProblems = null; } - public static void ReportTransPageNumProblems() + public static DialogResult ReportTransPageNumProblems() { if (TransPageNumProblems != null && TransPageNumProblems.Count > 0) { string pnProbl = null; foreach (string pstr in TransPageNumProblems) pnProbl = pnProbl + "\n" + pstr; - MessageBox.Show("Review the page numbers specified on transitions that transition to the following:\n" + pnProbl, "Inconsistent transition page numbers."); + return MessageBox.Show("Review the page numbers specified on transitions that transition to the following:\n" + pnProbl + + "\r\n\r\nDo you want to review the PDF output prior to the page number update?" + + "\r\n\r\nThis shouldd help to determine the cause of the inconsistent page numbers.", + "Inconsistent transition page numbers.", MessageBoxButtons.YesNo,MessageBoxIcon.Question); } + return DialogResult.No; } public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages) { @@ -189,6 +193,12 @@ namespace Volian.Print.Library _OriginalPageBreak = origPgBrk; _InsertBlankPages = insertBlankPages; } + private string _BeforePageNumberPdf = null; + public string BeforePageNumberPdf + { + get { return _BeforePageNumberPdf; } + set { _BeforePageNumberPdf = value; } + } public string Print(string pdfFolder, bool makePlacekeeper) { if (_MyItem is ProcedureInfo) @@ -201,8 +211,11 @@ namespace Volian.Print.Library // if the plant uses transition modifiers and/or page num in transition format, // need to do two passes. First pass, sets the pagenumbers for each item, // 2nd pass fills in the page numbers in transitions. - string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false); + DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\BeforePageNumber"); + if (!di.Exists) di.Create(); + string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\BeforePageNumber", false); if (retstr == null) return null; + BeforePageNumberPdf = retstr; ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo); return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper); }