Fixed code that reports the active database in use.

Changed debug output for Forced Pagination Items.
Fixed Pagination Logic for Background Documents.
This commit is contained in:
Rich 2014-03-07 00:35:23 +00:00
parent 0a4ed797b8
commit c77e0d2d2f
3 changed files with 12 additions and 2 deletions

View File

@ -40,6 +40,7 @@ namespace VEPROMS
this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc."; this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
this.labelCompanyName.Links.Add(0,23,"www.volian.com"); this.labelCompanyName.Links.Add(0,23,"www.volian.com");
this.labelServer.Text = string.Format("SQL Server: {0}", server); this.labelServer.Text = string.Format("SQL Server: {0}", server);
if (databaseName == null) databaseName = Regex.Replace(connectionString, "^.*Initial Catalog=([^;]*);.*$", "$1", RegexOptions.IgnoreCase);
this.labelDatabase.Text = string.Format("Database: {0}", databaseName); this.labelDatabase.Text = string.Format("Database: {0}", databaseName);
} }

View File

@ -121,6 +121,7 @@ namespace Volian.Controls.Library
if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2); if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2);
string databaseName = Database.SelectedDatabase; string databaseName = Database.SelectedDatabase;
sb.Append(string.Format("SQL Server: {0}", server)); sb.Append(string.Format("SQL Server: {0}", server));
if (databaseName == null) databaseName = Regex.Replace(connectionString, "^.*Initial Catalog=([^;]*);.*$", "$1", RegexOptions.IgnoreCase);
sb.AppendLine(string.Format("\t\tDatabase: {0}", databaseName)); sb.AppendLine(string.Format("\t\tDatabase: {0}", databaseName));
if (OutlookEmail) if (OutlookEmail)
sb.AppendLine("sent via outlook"); sb.AppendLine("sent via outlook");

View File

@ -326,7 +326,7 @@ namespace Volian.Print.Library
//_MyLog.ErrorFormat("<<< ERROR >>> Forced Pagination - ItemID = {0}\r\nLocation = '{1}'", MyItemInfo.ItemID, MyItemInfo.ShortPath); //_MyLog.ErrorFormat("<<< ERROR >>> Forced Pagination - ItemID = {0}\r\nLocation = '{1}'", MyItemInfo.ItemID, MyItemInfo.ShortPath);
_MyLog.ErrorFormat("<<< ERROR >>> Forced Pagination\r\n==>'Forced Pagination',{0},'{1}','{2}'" _MyLog.ErrorFormat("<<< ERROR >>> Forced Pagination\r\n==>'Forced Pagination',{0},'{1}','{2}'"
, MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath); , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath);
DebugPagination.WriteLine("=====>,'Yes','Forced Pagination',{0},{1},,{3},{4}", MyItemInfo.ItemID, YSize, 0, yLocation, MyItemInfo.DBSequence); DebugPagination.WriteLine("=====>,'Yes','Forced Pagination',{0},{1},,{3},'{4}'", MyItemInfo.ItemID, YSize, 0, yLocation, MyItemInfo.ShortPath);
retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin); retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin);
} }
private void ShowPageBreak(int instance, string message, string breakOrNot, float YSize, float yPageSize, float yWithinMargins, bool manualPageBreak) private void ShowPageBreak(int instance, string message, string breakOrNot, float YSize, float yPageSize, float yWithinMargins, bool manualPageBreak)
@ -433,12 +433,20 @@ namespace Volian.Print.Library
{ {
// If the next page break is beyond the next hls/caution/note, use the next // If the next page break is beyond the next hls/caution/note, use the next
// hls/caution/note. // hls/caution/note.
if (PageBreakOnStepList[0].YTop <= paraBreak.YTop || PageBreakOnStepList[0].YSize - yTop <= ySpaceOnCurPage) if (PageBreakOnStepList[0].YTop <= paraBreak.YTop )
{ {
paraBreak = PageBreakOnStepList[0]; paraBreak = PageBreakOnStepList[0];
PageBreakOnStepList.RemoveAt(0); PageBreakOnStepList.RemoveAt(0);
yTopNew = paraBreak.YTop - YTopMost; yTopNew = paraBreak.YTop - YTopMost;
} }
// The following code caused forced pagination for Catawba EOP BG - EP/1/A/5000/FR-C.1.SC..S16..N2..S4..S1.
//else if(PageBreakOnStepList[0].YSize - yTop <= ySpaceOnCurPage)
//{
// DebugPagination.WriteLine("======>>>>> Other Condition");
// paraBreak = PageBreakOnStepList[0];
// PageBreakOnStepList.RemoveAt(0);
// yTopNew = paraBreak.YTop - YTopMost;
//}
} }
RemoveProcessedParagraphs(myList, yTopNew - yTop); RemoveProcessedParagraphs(myList, yTopNew - yTop);
yTop = yTopNew; yTop = yTopNew;