Provide the option to display the PDF before the Page Number Transitions were updated to help the process of correcting pagination.

Fix the inheritance lookup for Transtitions
This commit is contained in:
Rich 2014-09-30 20:26:47 +00:00
parent 3b921bed4a
commit 8b9a092708
3 changed files with 28 additions and 4 deletions

View File

@ -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));

View File

@ -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)
{

View File

@ -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);
}