Get data into memory for approval generation so that page number transitions resolve

Fixed B2014-025:If not master/slave, load all data into memory for page number transitions. Present dialog if there are errors in page number transitions so that user can resolve.
Added a property to determine if page number transition has incorrect page number caused by length of step’s text/wrapping & pagination
Set property to determine if page number transition has incorrect page number caused by length of step’s text/wrapping & pagination
Add tracking of inconsistent page number transitions; if pdf already open, don’t run 2nd pass for page number transitions (resulting pdf had unresolved page numbers);
This commit is contained in:
2014-03-04 17:36:02 +00:00
parent 63acad915d
commit 622717ba1a
7 changed files with 61 additions and 8 deletions

View File

@@ -537,6 +537,7 @@ namespace VEPROMS
MyProcedure = myProc;
if (myProc.Sections != null)
{
// This is master/slave & a slave has been selected for printing (SelectedSlave > 0)
if (SelectedSlave > 0)
{
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = SelectedSlave;
@@ -555,6 +556,7 @@ namespace VEPROMS
frmStatus.ShowDialog();
if (frmStatus.CancelPrinting) break;
}
// This is a master/slave for printing of all slaves (SelectedSave == 0)
else if (SelectedSlave == 0)
{
for (int k = 1; k <= MyProcedure.MyDocVersion.MultiUnitCount; k++)
@@ -575,6 +577,7 @@ namespace VEPROMS
if (frmStatus.CancelPrinting) break;
}
}
// Not master/slave
else
{
SetupForProcedure();
@@ -583,7 +586,10 @@ namespace VEPROMS
pbPDFsStatus.Value = i;
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
if (MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier)
MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
else
MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked);
frmStatus.CloseWhenDone = true;
Application.DoEvents();
@@ -713,7 +719,9 @@ namespace VEPROMS
{
DateTime dtStart = DateTime.Now;
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
PromsPrinter.ClearTransPageNumProblems();
CreatePDFs();
PromsPrinter.ReportTransPageNumProblems();
if (VlnSettings.DebugMode)
{
MessageBox.Show(string.Format("{0} Minutes to Print All Procedures"
@@ -722,7 +730,7 @@ namespace VEPROMS
}
else // Production or Demo mode
{
MessageBox.Show("Completed Successfully","Print All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Completed Successfully", "Print All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
this.Close();
}

View File

@@ -1027,7 +1027,10 @@ namespace VEPROMS
}
else
{
pi = ProcedureInfo.GetItemAndChildren(pi.ItemID);
if (pi.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier)
pi = ProcedureInfo.GetItemAndChildrenByUnit(pi.ItemID, 0, pi.MyDocVersion.DocVersionConfig.SelectedSlave);
else
pi = ProcedureInfo.GetItemAndChildren(pi.ItemID);
pi.ChangeBarDate = myDTS;
cail = ContentAuditInfoList.GetSummary(pi.ItemID, pi.ItemID, false, pi.ChangeBarDate);
aail = AnnotationAuditInfoList.GetChronology(pi.ItemID, pi.ItemID, pi.ChangeBarDate);

View File

@@ -113,6 +113,7 @@ namespace VEPROMS
Application.DoEvents();
MyPromsPrinter.StatusChanged += new PromsPrinterStatusEvent(pp_StatusChanged);
DateTime tStart = DateTime.Now;
if (!CancelStop) PromsPrinter.ClearTransPageNumProblems();
do
{
_PdfFile = MyPromsPrinter.Print(PDFPath);
@@ -123,6 +124,7 @@ namespace VEPROMS
this.Close();
return;
}
if (!CancelStop) PromsPrinter.ReportTransPageNumProblems();
DateTime tEnd = DateTime.Now;
MyStatus = _PdfFile + " created.";
MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));