B2022-083: Support Conditional RO Values

This commit is contained in:
Jake
2022-07-26 20:01:25 +00:00
parent 439cf9de7a
commit d327ab08af
16 changed files with 2670 additions and 1743 deletions

View File

@@ -14,7 +14,7 @@ namespace Volian.Print.Library
public class PDFReport
{
#region Enums
public enum ReportType
{
SearchResults = 0,
@@ -28,7 +28,7 @@ namespace Volian.Print.Library
#endregion
#region Fields
private PdfWriter _MyPdfWriter;
private ICollection<ItemInfo> _ResultList;
@@ -57,31 +57,31 @@ namespace Volian.Print.Library
#endregion
#region Properties
public ICollection<ItemInfo> ResultList
{
get { return _ResultList; }
set { _ResultList = value; }
}
public string FileName
{
get { return _FileName; }
set { _FileName = value; }
}
public string ReportTitle
{
get { return _ReportTitle; }
set { _ReportTitle = value; }
}
public string TypesSelected
{
get { return _TypesSelected; }
set { _TypesSelected = value; }
}
public bool ShowAnnotations
{
get { return _ShowAnnotations; }
@@ -249,7 +249,7 @@ namespace Volian.Print.Library
#endregion
#region Public Methods
public void AddMainRODatabaseTitle(PdfPTable datatable, int dbTitleIndex, Font f2, Color bgColor)
{
string dbTitle = _ROFSTLookup.GetRODatabaseTitle(dbTitleIndex);
@@ -403,7 +403,7 @@ namespace Volian.Print.Library
bool foundMisMatch = false;
// n-1 Exclude the "Working Draft" entry from the list
int n = NewPath.Length-1;
int n = NewPath.Length - 1;
int jstart = (skipFirst) ? 1 : 0;
if (StripLast)
@@ -427,7 +427,7 @@ namespace Volian.Print.Library
if (!string.IsNullOrEmpty(NewPath[j]) && (foundMisMatch || OldPath.Length < j + 1 || NewPath[j] != OldPath[j]))
{
// B2020-006: Add hard space '\u160?'
sb.Append(sep + "".PadLeft(2 * level) + NewPath[j].Replace("\x11", " ")).Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace(@"\u9586?",@"\");
sb.Append(sep + "".PadLeft(2 * level) + NewPath[j].Replace("\x11", " ")).Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace(@"\u9586?", @"\");
sep = "\r\n";
foundMisMatch = true;
}
@@ -592,7 +592,7 @@ namespace Volian.Print.Library
level = NewPath.Length - 1;
}
}
return level;
}
@@ -603,7 +603,7 @@ namespace Volian.Print.Library
/// </summary>
/// <param name="document"></param>
/// <returns></returns>
private bool CreateResultsPDF(iTextSharp.text.Document document,int typ)
private bool CreateResultsPDF(iTextSharp.text.Document document, int typ)
{
int topMargin = 36;
@@ -670,18 +670,18 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light cyan
datatable.AddCell(cell);
// C2019-013 add sorted by information if sorting is used
cell = new PdfPCell(new Phrase(TypesSelected + ((SortedBy.Length >0)?string.Format("\n{0}",SortedBy):string.Empty), f3));
cell = new PdfPCell(new Phrase(TypesSelected + ((SortedBy.Length > 0) ? string.Format("\n{0}", SortedBy) : string.Empty), f3));
cell.HorizontalAlignment = Element.ALIGN_LEFT;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light cyan
datatable.AddCell(cell);
@@ -737,15 +737,15 @@ namespace Volian.Print.Library
{
lastSectNumAndTitle = string.Empty; // C2020-019 reset we are processing a different procedure
}
lastProcNum = curProcNum;
// B2020-006: When doing a section, don't remove the last item or the procedure title won't print (if section is only item found w/ search string)
string stepPath = AddGroup(subTable, item.SearchPath ?? item.ShortPath, lastPath, f2, item.IsSection ? false : true, new Color(0xC0, 0xFF, 0xC0), true); // light green for procedure number and title
// C2020-019 add section number and title if is different from last item and it is not a Word Section (item will be a section if search item was found in a Word section)
string curSectNumTitle = GetCurSectionNumTitle(item);
if (curSectNumTitle != string.Empty && curSectNumTitle != lastSectNumAndTitle && !item.IsSection)
{
AddColSpanCell(subTable, curSectNumTitle, f2, StepSectColor, 2, 0);
@@ -820,7 +820,7 @@ namespace Volian.Print.Library
}
}
if (str.Length > 0)
if (str.Length > 0)
p.Add(new Phrase(str, fnt));
return p;
@@ -857,18 +857,18 @@ namespace Volian.Print.Library
{
// Adjusted from 20,80 to 25,75 to account for long Procedure Numbers
float[] headerwidths = { 25, 75 };
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
BuildLibDocProcSetList();
int splitAt = FindSpitLevel()-1; // find the split level of the common path - for all procedure sets that use these library documents
int splitAt = FindSpitLevel() - 1; // find the split level of the common path - for all procedure sets that use these library documents
string lastDvPath = string.Empty;
Color AnnoBackgroundColor = new Color(0xFF, 0xFF, 0xC0);
Color TextBackgroundColor = Color.WHITE;
Color NotUsedBackgroundColor = Color.WHITE;
MyPageHelper pghlp = _MyPdfWriter.PageEvent as MyPageHelper;
pghlp.HeaderTable = LibDocTable(document, headerwidths, f2,null);
pghlp.HeaderTable = LibDocTable(document, headerwidths, f2, null);
foreach (DocumentInfo di in _LibDocList)
{
@@ -926,16 +926,16 @@ namespace Volian.Print.Library
private PdfPTable LibDocTable(iTextSharp.text.Document document, float[] headerwidths, iTextSharp.text.Font f2, DocumentInfo di)
{
PdfPTable datatable = new PdfPTable(1);// (headerwidths);
PdfPTable colheader = new PdfPTable(headerwidths);
PdfPTable colheader = new PdfPTable(headerwidths);
datatable.HeaderRows = 2;
datatable.KeepTogether = false;
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;
@@ -977,9 +977,9 @@ namespace Volian.Print.Library
private void PutROusageForProcedure(PdfPTable curTable, Dictionary<string, List<ItemInfo>> rosused, float[] headerwidths)
{
//if (rosused.Count == 0) return; // nothing to process
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
foreach (string roKey in rosused.Keys)
{
@@ -1006,7 +1006,7 @@ namespace Volian.Print.Library
{
ROTitleCell.BackgroundColor = new Color(0xDC, 0xE7, 0xC9); //new Color(0xD0, 0xF0, 0xD0);//ligt green //new Color(0xC8, 0xC8, 0x91);//(0xAF, 0xD8, 0xD8);//(0xF5, 0xE4, 0xA0);
}
rotable.AddCell(ROTitleCell); // put RO value and description
}
}
@@ -1042,11 +1042,11 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
//cell.Colspan = 2;
@@ -1134,7 +1134,7 @@ namespace Volian.Print.Library
{
string dictKey = GetCurProcNum(item.SearchPath) + " " + GetCurSectionNumTitle(item);
if (dictKey != null && dictKey != string.Empty)
if (!string.IsNullOrEmpty(dictKey))
{
if (procRoUse.ContainsKey(dictKey))
{
@@ -1151,9 +1151,9 @@ namespace Volian.Print.Library
private void PutStepListForProcedure(PdfPTable rotable, SortedDictionary<string, ItemInfo> sortedStepList)
{
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
foreach (ItemInfo itm in sortedStepList.Values)
{
@@ -1165,11 +1165,11 @@ namespace Volian.Print.Library
sortedStepList.Clear();
}
private void PutROusageForROID(PdfPTable curTable, SortedDictionary<string, List<ItemInfo>> procRoUse, float[] headerwidths, int splitAt , bool moreThanOneProcSet)
private void PutROusageForROID(PdfPTable curTable, SortedDictionary<string, List<ItemInfo>> procRoUse, float[] headerwidths, int splitAt, bool moreThanOneProcSet)
{
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
SortedDictionary<string, ItemInfo> sortedStepList = new SortedDictionary<string, ItemInfo>();
string lastProcKey = string.Empty;
@@ -1249,14 +1249,15 @@ namespace Volian.Print.Library
{
string rotitle = string.Empty;
ROFSTLookup myrofstlookup = (itm == null)? _ROFSTLookup : itm.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(itm.MyDocVersion);
List<string> roTitleList = myrofstlookup.GetROTitleAndGroupPath(roid,_IncludeMissingROs,_ConvertCaretToDelta);
ROFSTLookup myrofstlookup = (itm == null) ? _ROFSTLookup : itm.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(itm.MyDocVersion);
List<string> roTitleList = myrofstlookup.GetROTitleAndGroupPath(roid, _IncludeMissingROs, _ConvertCaretToDelta);
if (roTitleList != null && roTitleList.Count > 0)
{
for (int cnt = 0; cnt < roTitleList.Count; cnt++)
{
if (cnt == roTitleList.Count - 1)
if (cnt == roTitleList.Count - 1) // Last roTitle in list, don't add a NewLine character after the value
rotitle += roTitleList[cnt];
else
rotitle += roTitleList[cnt] + "\n ";
@@ -1269,15 +1270,15 @@ namespace Volian.Print.Library
private void AddROHeaderGroup(PdfPTable datatable, string curROID, ItemInfo itm, Font f2, Color bgColor)
{
string headerText = GetROTitleAndGroup(curROID, itm);
if (headerText != null && headerText.Length > 0)
if (!string.IsNullOrEmpty(headerText) && headerText.Length > 0)
{
PdfPCell cell = new PdfPCell(new Phrase(headerText, f2));
cell.Colspan = 2;
if (headerText.StartsWith("Missing RO"))
cell.BackgroundColor = Color.PINK;
else
cell.BackgroundColor = bgColor;
cell.BackgroundColor = (headerText.StartsWith("Missing RO")) ? Color.PINK : bgColor;
cell.BorderWidthTop = 1;
datatable.AddCell(cell);
}
}
@@ -1285,6 +1286,7 @@ namespace Volian.Print.Library
private void BuildROUsageTableByRO(iTextSharp.text.Document document)
{
SortedDictionary<string, List<ItemInfo>> procRoUse = new SortedDictionary<string, List<ItemInfo>>();
float[] headerwidths = { 20, 80 };
PdfPTable datatable = new PdfPTable(1);
PdfPTable colHeader = new PdfPTable(headerwidths);
@@ -1292,11 +1294,11 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 0, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light blue
@@ -1360,9 +1362,9 @@ namespace Volian.Print.Library
// Check for different ROID
string curROID = item.FoundROID;
differentRO = lastROID != string.Empty && curROID.Substring(0, 12) != lastROID.Substring(0, 12);
differentRO = (!string.IsNullOrEmpty(lastROID) && !string.IsNullOrEmpty(curROID) && curROID.Substring(0, 12) != lastROID.Substring(0, 12));
if (procRoUse.Count > 0 && (differentProcSet || differentRO))
if (procRoUse.Count > 0 && (differentProcSet || differentRO))
{
if (!moreThanOneProcSet && !printedSetTitle)
{
@@ -1450,55 +1452,68 @@ namespace Volian.Print.Library
private void BuildCompleteROReport(iTextSharp.text.Document document)
{
CompleteROReport compRORpt = new CompleteROReport(_MyPdfWriter, document,_RODataFile, _ConvertCaretToDelta, _IncludeEmptyROFields);
CompleteROReport compRORpt = new CompleteROReport(_MyPdfWriter, document, _RODataFile, _ConvertCaretToDelta, _IncludeEmptyROFields);
compRORpt.F10 = pdf.GetFont("Courier New", 10, 0, Color.BLACK);
compRORpt.F10Bold = pdf.GetFont("Courier New", 10, 1, Color.BLACK);
compRORpt.F12 = pdf.GetFont("Courier New", 12, 0, Color.BLACK);
compRORpt.F12Bold = pdf.GetFont("Courier New", 12, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
compRORpt.F14 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
compRORpt.ROFstID = _ROFSTLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.ROFstID;
// C2017-036 Get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
compRORpt.F14 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
//B2022 - 083: Support Conditional RO Values
compRORpt.ROFstID = _ROFSTLookup.RofstID;
compRORpt.Run();
}
private string GetROTitleAndGroupsForSummary(List<string>roTitleList, List<string> prevROTitleList)
private string GetROTitleAndGroupsForSummary(List<string> roTitleList, List<string> prevROTitleList)
{
string rotitle = string.Empty;
string indent = string.Empty;
for (int icnt = 0; icnt < roTitleList.Count; icnt++)
for (int icnt = 0; icnt < roTitleList.Count; icnt++)
{
indent += " ";
if (icnt == roTitleList.Count - 1)
{
indent += " ";
if (icnt == roTitleList.Count - 1)
{
rotitle += indent + roTitleList[icnt]; // this should be the ro description
break; //break out of for loop
}
if (prevROTitleList == null || (icnt < roTitleList.Count && icnt < prevROTitleList.Count && prevROTitleList[icnt] != roTitleList[icnt]))
{
if (rotitle == string.Empty && prevROTitleList != null)
rotitle = "\n";
rotitle += indent + roTitleList[icnt] + "\n";
}
rotitle += indent + roTitleList[icnt]; // this should be the ro description
break; //break out of for loop
}
if (prevROTitleList == null || (icnt < roTitleList.Count && icnt < prevROTitleList.Count && prevROTitleList[icnt] != roTitleList[icnt]))
{
if (rotitle == string.Empty && prevROTitleList != null)
rotitle = "\n";
rotitle += indent + roTitleList[icnt] + "\n";
}
}
return rotitle;
}
private List<string> AddROHeaderGroupForSummary(PdfPTable datatable, string curROID,List<string> prevROTitleList, Font f2, Color bgColor)
private List<string> AddROHeaderGroupForSummary(PdfPTable datatable, string curROID, List<string> prevROTitleList, Font f2, Color bgColor)
{
List<string> roTitleList = _ROFSTLookup.GetROTitleAndGroupPath(curROID,_IncludeMissingROs,_ConvertCaretToDelta);
List<string> roTitleList = _ROFSTLookup.GetROTitleAndGroupPath(curROID, _IncludeMissingROs, _ConvertCaretToDelta);
string headerText = GetROTitleAndGroupsForSummary(roTitleList, prevROTitleList);
if (headerText.Length > 0)
{
Paragraph pgh = new Paragraph(headerText, f2);
PdfPCell cell = new PdfPCell(pgh);
cell.FollowingIndent = 72;
cell.Colspan = 2;
cell.BorderColor = Color.WHITE;
cell.BackgroundColor = Color.WHITE;
cell.BorderWidthTop = 1;
datatable.AddCell(cell);
}
return roTitleList;
}
@@ -1509,11 +1524,11 @@ namespace Volian.Print.Library
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
datatable.LockedWidth = true;
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
// C2017-036 get best available proportional font for symbols that looks close to Arial
// Note that Microsoft no longer supplies Arial Unicode MS as of Word16
iTextSharp.text.Font f1 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 14, 1, Color.BLACK);
iTextSharp.text.Font f2 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 10, 0, Color.BLACK);
iTextSharp.text.Font f3 = pdf.GetFont(Volian.Base.Library.vlnFont.ReportsFont, 12, 1, Color.BLACK);
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
@@ -1527,22 +1542,22 @@ namespace Volian.Print.Library
cell = new PdfPCell(new Phrase(roFSTDateTime, f2));
cell.BorderColor = Color.WHITE;
datatable.AddCell(cell);
datatable.HeaderRows = 2;//3 + (ProcSetList.Count == 1 ? 1 : 0);
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
string lastROID = string.Empty;
List<string> prevROTitleList = null;
List<string> prevROTitleList = null;
int lastDBindex = -1;
foreach (string curROID in _ROList)
{
string[] tmp = curROID.TrimEnd(',').Split(':'); //curROID.Split(':');// this is the RO FST id number (for plants with multiple RO FSTs)
string rolst = (tmp.Length == 2)? tmp[1] : tmp[0];
string rolst = (tmp.Length == 2) ? tmp[1] : tmp[0];
string[] roIdslst = rolst.Split(',');
foreach (string cROID in roIdslst)
{
if (string.IsNullOrEmpty(cROID))
if (string.IsNullOrEmpty(cROID))
break;
if (cROID.Length == 4)
@@ -1579,7 +1594,7 @@ namespace Volian.Print.Library
}
}
private void ProcessROChild(PdfPTable datatable, iTextSharp.text.Font f2, iTextSharp.text.Font f3, ref PdfPCell cell, ref string lastROID, ref List<string> prevROTitleList, ref int lastDBindex,ROFSTLookup.rochild cld)
private void ProcessROChild(PdfPTable datatable, iTextSharp.text.Font f2, iTextSharp.text.Font f3, ref PdfPCell cell, ref string lastROID, ref List<string> prevROTitleList, ref int lastDBindex, ROFSTLookup.rochild cld)
{
if (cld.children == null || cld.children.Length <= 0) // leaf node
{
@@ -1625,7 +1640,7 @@ namespace Volian.Print.Library
#endregion
#region Private Static Methods
private static PdfPTable BuildSubTable(iTextSharp.text.Document document, float[] headerwidths)
{
PdfPTable subtable = new PdfPTable(headerwidths);
@@ -1874,7 +1889,7 @@ namespace Volian.Print.Library
public class MyPageHelper : PdfPageEventHelper
{
#region Fields
private PdfPTable _HeaderTable = null;
protected PdfTemplate total;
protected BaseFont helv;
@@ -1884,7 +1899,7 @@ namespace Volian.Print.Library
#endregion
#region Properties
public PdfPTable HeaderTable
{
get { return _HeaderTable; }
@@ -1894,7 +1909,7 @@ namespace Volian.Print.Library
#endregion
#region Constructors
public MyPageHelper(string byLine)
{
_ByLine = byLine;
@@ -1903,7 +1918,7 @@ namespace Volian.Print.Library
#endregion
#region Public Methods
public override void OnOpenDocument(PdfWriter writer, iTextSharp.text.Document document)
{
total = writer.DirectContent.CreateTemplate(100, 100);
@@ -1918,20 +1933,20 @@ namespace Volian.Print.Library
cb.SaveState();
if (HeaderTable != null)
HeaderTable.WriteSelectedRows(0, 2, 36, document.Top+44, cb);
HeaderTable.WriteSelectedRows(0, 2, 36, document.Top + 44, cb);
String text = "Page " + writer.PageNumber + " of ";
float textBase = document.Bottom - 19;//20;
cb.BeginText();
cb.SetFontAndSize(helv, ptSize);
float posCenter = document.Left + ((document.Right - document.Left) / 2) - (helv.GetWidthPoint(text+"XX", ptSize) / 2);
float posCenter = document.Left + ((document.Right - document.Left) / 2) - (helv.GetWidthPoint(text + "XX", ptSize) / 2);
cb.SetTextMatrix(posCenter, textBase);
cb.ShowText(text);
cb.EndText();
cb.AddTemplate(total, posCenter + helv.GetWidthPoint(text, ptSize), textBase);
cb.RestoreState();
AddVolianFooter(writer,document);
AddVolianFooter(writer, document);
AddDateFooter(writer, document);
}
@@ -1949,7 +1964,7 @@ namespace Volian.Print.Library
#endregion
#region Private Methods
private void AddVolianFooter(PdfWriter writer, iTextSharp.text.Document document)
{
PdfContentByte cb = writer.DirectContent;