Logic to read the meta file and generate the Complete RO Report
Logic to generate a Complete RO Report
This commit is contained in:
parent
246e09e0da
commit
12e5c4ac76
File diff suppressed because it is too large
Load Diff
@ -21,7 +21,7 @@ namespace Volian.Print.Library
|
|||||||
ReferencedObjectSummary = 4,
|
ReferencedObjectSummary = 4,
|
||||||
ReferencedObjectComplete = 5
|
ReferencedObjectComplete = 5
|
||||||
}
|
}
|
||||||
|
private PdfWriter _MyPdfWriter;
|
||||||
private ICollection<ItemInfo> _ResultList;
|
private ICollection<ItemInfo> _ResultList;
|
||||||
public ICollection<ItemInfo> ResultList
|
public ICollection<ItemInfo> ResultList
|
||||||
{
|
{
|
||||||
@ -72,6 +72,8 @@ namespace Volian.Print.Library
|
|||||||
private List<string> _ROList;
|
private List<string> _ROList;
|
||||||
private ROFSTLookup _ROFSTLookup;
|
private ROFSTLookup _ROFSTLookup;
|
||||||
private bool _IncludeMissingROs = false;
|
private bool _IncludeMissingROs = false;
|
||||||
|
private bool _ConvertCaretToDelta = true;
|
||||||
|
private bool _IncludeEmptyROFields = false;
|
||||||
|
|
||||||
// Search Results Report
|
// Search Results Report
|
||||||
public PDFReport(string reportTitle, string typesSelected, ICollection<ItemInfo> resultList, string fileName)
|
public PDFReport(string reportTitle, string typesSelected, ICollection<ItemInfo> resultList, string fileName)
|
||||||
@ -95,7 +97,7 @@ namespace Volian.Print.Library
|
|||||||
_ByLine = "Generated By PROMS";
|
_ByLine = "Generated By PROMS";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transition and RO Usage
|
// RO Usage
|
||||||
public PDFReport(string reportTitle, ICollection<ItemInfo> resultList, string fileName, bool sortUsageByProcedure, bool includeMissingROs)
|
public PDFReport(string reportTitle, ICollection<ItemInfo> resultList, string fileName, bool sortUsageByProcedure, bool includeMissingROs)
|
||||||
{
|
{
|
||||||
_ResultList = resultList;
|
_ResultList = resultList;
|
||||||
@ -107,14 +109,17 @@ namespace Volian.Print.Library
|
|||||||
_IncludeMissingROs = includeMissingROs;
|
_IncludeMissingROs = includeMissingROs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RO Complete Report
|
// RO Complete RO Report
|
||||||
public PDFReport(string reportTitle, string roDataFile, string outfile, bool completeReport)
|
public PDFReport(string reportTitle, string roDataFile, string outfile, ROFSTLookup fstlookup, bool completeReport, bool convertCaretToDelta, bool includeEmptyROFields)
|
||||||
{
|
{
|
||||||
_FileName = outfile;
|
_FileName = outfile;
|
||||||
_ReportTitle = reportTitle;
|
_ReportTitle = reportTitle;
|
||||||
_ReportType = (int)ReportType.ReferencedObjectComplete;
|
_ReportType = (int)ReportType.ReferencedObjectComplete;
|
||||||
_ByLine = "Complete RO Report";
|
_ByLine = "Complete Referenced Objects Report";
|
||||||
_RODataFile = roDataFile;
|
_RODataFile = roDataFile;
|
||||||
|
_ConvertCaretToDelta = convertCaretToDelta;
|
||||||
|
_ROFSTLookup = fstlookup;
|
||||||
|
_IncludeEmptyROFields = includeEmptyROFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RO Summary Report
|
// RO Summary Report
|
||||||
@ -128,112 +133,6 @@ namespace Volian.Print.Library
|
|||||||
_ROList = roList;
|
_ROList = roList;
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void Build2()
|
|
||||||
//{
|
|
||||||
// iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.LETTER, 36, 36, 36, 36);
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(_FileName, FileMode.Create));
|
|
||||||
|
|
||||||
// // we add some meta information to the document
|
|
||||||
// document.SetMargins(36, 36, 36, 36);
|
|
||||||
// // step 3: we open the document
|
|
||||||
// document.Open();
|
|
||||||
// AddTable(document, 20, 80);
|
|
||||||
// //AddTable(document, 10, 90);
|
|
||||||
// //AddTable(document, 10, 100);
|
|
||||||
// //AddTable(document, 15, 75);
|
|
||||||
// //AddTable(document, 20, 70);
|
|
||||||
// //AddTable(document, 25, 65);
|
|
||||||
// //AddTable(document, 30, 60);
|
|
||||||
// document.Close();
|
|
||||||
// }
|
|
||||||
// catch (Exception ex)
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//private void AddTable(iTextSharp.text.Document document, int width1, int width2)
|
|
||||||
//{
|
|
||||||
// float[] headerwidths = { width1, width2 };
|
|
||||||
// PdfPTable datatable = new PdfPTable(headerwidths);
|
|
||||||
// datatable.HeaderRows = 3;
|
|
||||||
// datatable.FooterRows = 1;
|
|
||||||
// //datatable.Padding = 4;
|
|
||||||
// //datatable.DefaultCell.Padding = 4;
|
|
||||||
// //datatable.Spacing = 0;
|
|
||||||
// //datatable.setBorder(Rectangle.NO_BORDER);
|
|
||||||
// //datatable.Widths = headerwidths;
|
|
||||||
// //datatable.WidthPercentage = 100;
|
|
||||||
// datatable.TotalWidth = (width1 + width2) * 5;
|
|
||||||
// datatable.LockedWidth = true;
|
|
||||||
// // the first cell spans 10 columns
|
|
||||||
// //iTextSharp.text.Font f1 = FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 14, Font.BOLD);
|
|
||||||
// iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
|
||||||
|
|
||||||
// PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
|
|
||||||
// //Font f2 = FontFactory.GetFont(FontFactory.HELVETICA, 10);
|
|
||||||
// //FontFactory.RegisterDirectory(FontFind.FontDir);
|
|
||||||
// //iTextSharp.text.Font f2 = FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 10);
|
|
||||||
// iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
|
|
||||||
// //iTextSharp.text.Font f3 = FontFactory.GetFont("Prestige Elite Tall", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 9);
|
|
||||||
// iTextSharp.text.Font f3 = pdf.GetFont("Prestige Elite Tall", 9, 0, Color.BLACK);
|
|
||||||
// cell.HorizontalAlignment = Element.ALIGN_CENTER;
|
|
||||||
// //cell.Leading = 20;
|
|
||||||
// cell.Colspan = 2;
|
|
||||||
// //cell.Border = Rectangle.NO_BORDER;
|
|
||||||
// cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0);
|
|
||||||
// datatable.AddCell(cell);
|
|
||||||
// Color subHeaderColor = new Color(0xD0, 0xF0, 0xD0);
|
|
||||||
// // These cells span 2 rows
|
|
||||||
// //datatable.DefaultCellBorderWidth = 2;
|
|
||||||
// //datatable.DefaultHorizontalAlignment = 1;
|
|
||||||
// //datatable.DefaultRowspan = 2;
|
|
||||||
// datatable.DefaultCell.Padding = 4;
|
|
||||||
// datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
|
|
||||||
// AddCell(datatable, "Step", f2, subHeaderColor);
|
|
||||||
// AddCell(datatable, "Text", f2, subHeaderColor);
|
|
||||||
// AddCell(datatable, "Step", f2, subHeaderColor);
|
|
||||||
// AddCell(datatable, "Text", f2, subHeaderColor);
|
|
||||||
// datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
|
|
||||||
// //datatable.DefaultCellBorderWidth = 1;
|
|
||||||
// //datatable.DefaultRowspan = 1;
|
|
||||||
// //datatable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
|
|
||||||
// string lastDvPath = "";
|
|
||||||
// string lastPath = "";
|
|
||||||
// Color AnnoColor = new Color(0xFF, 0xFF, 0xC0);
|
|
||||||
// Color TextColor = Color.WHITE;
|
|
||||||
// Color SectColor = Color.LIGHT_GRAY;
|
|
||||||
// foreach (ItemInfo item in _ResultList)
|
|
||||||
// {
|
|
||||||
// if (item.SearchDVPath != lastDvPath)
|
|
||||||
// AddGroup(datatable, item.SearchDVPath, lastDvPath, f2, false, new Color(0xC0, 0xFF, 0xC0));
|
|
||||||
// lastDvPath = item.SearchDVPath;
|
|
||||||
// //if (item.SearchPath != lastPath)
|
|
||||||
// string stepPath = AddGroup(datatable, item.SearchPath, lastPath, f2, true, new Color(0xE0, 0xFF, 0xE0));
|
|
||||||
// lastPath = item.SearchPath;
|
|
||||||
// AddCell(datatable, stepPath, f2, (item.IsSection ? SectColor : TextColor));
|
|
||||||
// if (item.DisplayText.Contains("|")) // Need a better way to determine if it is a table.
|
|
||||||
// AddCell(datatable, item.DisplayText, f3, TextColor);
|
|
||||||
// else
|
|
||||||
// AddCell(datatable, item.DisplayText, f2, (item.IsSection ? SectColor : TextColor));
|
|
||||||
// if (item.ItemAnnotationCount > 0)
|
|
||||||
// {
|
|
||||||
// foreach (AnnotationInfo ai in item.ItemAnnotations)
|
|
||||||
// {
|
|
||||||
// AddCell(datatable, ai.MyAnnotationType.Name, f2, AnnoColor);
|
|
||||||
// AddCell(datatable, ai.SearchText, f2, AnnoColor);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// document.Add(datatable);
|
|
||||||
//}
|
|
||||||
//private static void AddCell(PdfPTable datatable, string str, iTextSharp.text.Font fnt, Color bgColor)
|
|
||||||
//{
|
|
||||||
// PdfPCell cell = new PdfPCell(new Phrase(str, fnt));
|
|
||||||
// cell.BackgroundColor = bgColor;
|
|
||||||
// datatable.AddCell(cell);
|
|
||||||
//}
|
|
||||||
private string AddGroup(PdfPTable datatable, string dvPath, string lastDvPath, Font f2, bool StripLast, Color bgColor, bool skipFirst)
|
private string AddGroup(PdfPTable datatable, string dvPath, string lastDvPath, Font f2, bool StripLast, Color bgColor, bool skipFirst)
|
||||||
{
|
{
|
||||||
int level = 0;
|
int level = 0;
|
||||||
@ -297,23 +196,8 @@ namespace Volian.Print.Library
|
|||||||
string[] NewPath = path.Split("\x7".ToCharArray());
|
string[] NewPath = path.Split("\x7".ToCharArray());
|
||||||
string pnumtitle = NewPath[1];
|
string pnumtitle = NewPath[1];
|
||||||
pnumtitle = pnumtitle.Replace('\x11', ' ');
|
pnumtitle = pnumtitle.Replace('\x11', ' ');
|
||||||
//return NewPath[1].Replace("\x11:"," ");
|
|
||||||
return pnumtitle;
|
return pnumtitle;
|
||||||
}
|
}
|
||||||
//private string GetCurSectionNumTitle(string path)
|
|
||||||
//{
|
|
||||||
// string[] NewPath = path.Split("\x7".ToCharArray());
|
|
||||||
// int idx = 2; //start of section and subsection num and title
|
|
||||||
// int stpidx = NewPath.Length - 1; // last position is the step number
|
|
||||||
// string rtnstr = "";
|
|
||||||
// while (idx < stpidx)
|
|
||||||
// {
|
|
||||||
// rtnstr += NewPath[idx++];
|
|
||||||
// if (idx < stpidx)
|
|
||||||
// rtnstr += "\n ";
|
|
||||||
// }
|
|
||||||
// return rtnstr; // srting containing section and subsection number/titles
|
|
||||||
//}
|
|
||||||
private string GetCurSectionNumTitle(ItemInfo itm)
|
private string GetCurSectionNumTitle(ItemInfo itm)
|
||||||
{
|
{
|
||||||
string rtnstr = "";
|
string rtnstr = "";
|
||||||
@ -476,8 +360,8 @@ namespace Volian.Print.Library
|
|||||||
string fileName = _FileName.ToLower().Replace(".pdf", suffix + ".pdf");
|
string fileName = _FileName.ToLower().Replace(".pdf", suffix + ".pdf");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(fileName, FileMode.Create));
|
_MyPdfWriter = PdfWriter.GetInstance(document, new FileStream(fileName, FileMode.Create));
|
||||||
writer.PageEvent = new MyPageHelper(_ByLine); // JSJ - 7/8/2011
|
_MyPdfWriter.PageEvent = new MyPageHelper(_ByLine); // JSJ - 7/8/2011
|
||||||
document.SetMargins(36, 36, 36, 36);
|
document.SetMargins(36, 36, 36, 36);
|
||||||
document.Open();
|
document.Open();
|
||||||
_FileName = fileName;
|
_FileName = fileName;
|
||||||
@ -529,35 +413,25 @@ namespace Volian.Print.Library
|
|||||||
//datatable.FooterRows = 1;
|
//datatable.FooterRows = 1;
|
||||||
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
|
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
|
||||||
datatable.LockedWidth = true;
|
datatable.LockedWidth = true;
|
||||||
//FontFactory.RegisterDirectory(FontFind.FontDir);
|
|
||||||
//iTextSharp.text.Font f1 = FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 14, Font.BOLD);
|
|
||||||
//iTextSharp.text.Font f2 = FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 10);
|
|
||||||
//iTextSharp.text.Font f3 = FontFactory.GetFont("Prestige Elite Tall", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 9);
|
|
||||||
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
||||||
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
|
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
|
||||||
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
|
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
|
||||||
//iTextSharp.text.Font f3 = pdf.GetFont("Prestige Elite Tall", 9, 0, Color.BLACK);
|
|
||||||
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
|
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
|
||||||
cell.HorizontalAlignment = Element.ALIGN_CENTER;
|
cell.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||||
//cell.Colspan = 2;
|
|
||||||
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0);
|
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0);
|
||||||
datatable.AddCell(cell);
|
datatable.AddCell(cell);
|
||||||
cell = new PdfPCell(new Phrase(TypesSelected, f3));
|
cell = new PdfPCell(new Phrase(TypesSelected, f3));
|
||||||
cell.HorizontalAlignment = Element.ALIGN_LEFT;
|
cell.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||||
//cell.Colspan = 2;
|
|
||||||
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0);
|
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0);
|
||||||
datatable.AddCell(cell);
|
datatable.AddCell(cell);
|
||||||
|
|
||||||
BuildSearchResultsProcSetList();
|
BuildSearchResultsProcSetList();
|
||||||
datatable.HeaderRows = 3 + (ProcSetList.Count == 1 ? 1 : 0);
|
datatable.HeaderRows = 3 + (ProcSetList.Count == 1 ? 1 : 0);
|
||||||
int splitAt = FindSpitLevel(); // find the split level of the common path - for all procedure sets that use these library documents
|
int splitAt = FindSpitLevel(); // find the split level of the common path - for all procedure sets that use these library documents
|
||||||
//AddMainPathGroup(datatable, ProcSetList[0].ToString(), splitAt, f2, Color.LIGHT_GRAY, 0);
|
|
||||||
|
|
||||||
Color subHeaderColor = new Color(0xD0, 0xF0, 0xD0);
|
Color subHeaderColor = new Color(0xD0, 0xF0, 0xD0);
|
||||||
datatable.DefaultCell.Padding = 4;
|
datatable.DefaultCell.Padding = 4;
|
||||||
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
|
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||||
//AddCell(datatable, "Step", f2, subHeaderColor);
|
|
||||||
//AddCell(datatable, "Text", f2, subHeaderColor);
|
|
||||||
AddCell(colHeader, "Step", f2, subHeaderColor);
|
AddCell(colHeader, "Step", f2, subHeaderColor);
|
||||||
AddCell(colHeader, "Text", f2, subHeaderColor);
|
AddCell(colHeader, "Text", f2, subHeaderColor);
|
||||||
//datatable.AddCell(colHeader);
|
//datatable.AddCell(colHeader);
|
||||||
@ -565,7 +439,6 @@ namespace Volian.Print.Library
|
|||||||
//AddCell(datatable, "Step", f2, subHeaderColor);
|
//AddCell(datatable, "Step", f2, subHeaderColor);
|
||||||
//AddCell(datatable, "Text", f2, subHeaderColor);
|
//AddCell(datatable, "Text", f2, subHeaderColor);
|
||||||
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
|
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||||
//string lastDvPath = "";
|
|
||||||
string lastPath = "";
|
string lastPath = "";
|
||||||
Color AnnoColor = new Color(0xFF, 0xFF, 0xC0);
|
Color AnnoColor = new Color(0xFF, 0xFF, 0xC0);
|
||||||
Color TextColor = Color.WHITE;
|
Color TextColor = Color.WHITE;
|
||||||
@ -591,16 +464,8 @@ namespace Volian.Print.Library
|
|||||||
subTable = new PdfPTable(headerwidths);
|
subTable = new PdfPTable(headerwidths);
|
||||||
}
|
}
|
||||||
lastProcNum = curProcNum;
|
lastProcNum = curProcNum;
|
||||||
//if (item.SearchDVPath != lastDvPath)
|
|
||||||
// AddGroup(datatable, item.SearchDVPath, lastDvPath, f2, false, Color.LIGHT_GRAY, true);
|
|
||||||
|
|
||||||
//AddGroup(datatable, item.SearchDVPath, lastDvPath, f2, false, new Color(0xC0, 0xFF, 0xC0), true);
|
|
||||||
//lastDvPath = item.SearchDVPath;
|
|
||||||
//string stepPath = AddGroup(datatable, item.SearchPath, lastPath, f2, true, new Color(0xE0, 0xFF, 0xE0), true);
|
|
||||||
//string stepPath = AddGroup(datatable, item.SearchPath, lastPath, f2, true, new Color(0xC0, 0xFF, 0xC0), true);
|
|
||||||
string stepPath = AddGroup(subTable, item.SearchPath ?? item.ShortPath, lastPath, f2, true, new Color(0xC0, 0xFF, 0xC0), true);
|
string stepPath = AddGroup(subTable, item.SearchPath ?? item.ShortPath, lastPath, f2, true, new Color(0xC0, 0xFF, 0xC0), true);
|
||||||
lastPath = item.SearchPath ?? item.ShortPath;
|
lastPath = item.SearchPath ?? item.ShortPath;
|
||||||
//AddCell(datatable, stepPath, f2, (item.IsSection ? SectColor : TextColor));
|
|
||||||
stepPath = BuildStepTab(item);
|
stepPath = BuildStepTab(item);
|
||||||
AddCell(subTable, stepPath, f2, (item.IsSection ? SectColor : TextColor));
|
AddCell(subTable, stepPath, f2, (item.IsSection ? SectColor : TextColor));
|
||||||
// This was for the old 16-bit style of table - jsj 7/7/2011
|
// This was for the old 16-bit style of table - jsj 7/7/2011
|
||||||
@ -613,8 +478,6 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
foreach (AnnotationInfo ai in item.ItemAnnotations)
|
foreach (AnnotationInfo ai in item.ItemAnnotations)
|
||||||
{
|
{
|
||||||
//AddCell(datatable, ai.MyAnnotationType.Name, f2, AnnoColor);
|
|
||||||
//AddCell(datatable, ai.SearchText, f2, AnnoColor);
|
|
||||||
AddCell(subTable, ai.MyAnnotationType.Name, f2, AnnoColor);
|
AddCell(subTable, ai.MyAnnotationType.Name, f2, AnnoColor);
|
||||||
AddCell(subTable, ai.SearchText, f2, AnnoColor);
|
AddCell(subTable, ai.SearchText, f2, AnnoColor);
|
||||||
}
|
}
|
||||||
@ -730,8 +593,6 @@ namespace Volian.Print.Library
|
|||||||
Color subHeaderColor = new Color(0xD0, 0xF0, 0xD0);
|
Color subHeaderColor = new Color(0xD0, 0xF0, 0xD0);
|
||||||
datatable.DefaultCell.Padding = 4;
|
datatable.DefaultCell.Padding = 4;
|
||||||
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
|
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||||
//AddCell(datatable, "Procedure", f2, subHeaderColor);
|
|
||||||
//AddCell(datatable, "Section", f2, subHeaderColor);
|
|
||||||
AddCell(colheader, "Procedure", f2, subHeaderColor);
|
AddCell(colheader, "Procedure", f2, subHeaderColor);
|
||||||
AddCell(colheader, "Section", f2, subHeaderColor);
|
AddCell(colheader, "Section", f2, subHeaderColor);
|
||||||
datatable.AddCell(colheader);
|
datatable.AddCell(colheader);
|
||||||
@ -740,30 +601,18 @@ namespace Volian.Print.Library
|
|||||||
Color AnnoBackgroundColor = new Color(0xFF, 0xFF, 0xC0);
|
Color AnnoBackgroundColor = new Color(0xFF, 0xFF, 0xC0);
|
||||||
Color TextBackgroundColor = Color.WHITE;
|
Color TextBackgroundColor = Color.WHITE;
|
||||||
Color NotUsedBackgroundColor = Color.WHITE;
|
Color NotUsedBackgroundColor = Color.WHITE;
|
||||||
//BuildProcSetList();
|
|
||||||
//int splitAt = FindSpitLevel(); // find the split level of the common path - for all procedure sets that use these library documents
|
|
||||||
//bool doMainProcSetpath = true;
|
|
||||||
foreach (DocumentInfo di in _LibDocList)
|
foreach (DocumentInfo di in _LibDocList)
|
||||||
{
|
{
|
||||||
PdfPTable subtable = new PdfPTable(headerwidths);
|
PdfPTable subtable = new PdfPTable(headerwidths);
|
||||||
subtable.HeaderRows = 0;
|
subtable.HeaderRows = 0;
|
||||||
//if (doMainProcSetpath)
|
|
||||||
//{
|
|
||||||
// AddMainPathGroup(datatable, ProcSetList[0].ToString(), splitAt, f2, Color.LIGHT_GRAY, 0);//2);
|
|
||||||
// doMainProcSetpath = false;
|
|
||||||
//}
|
|
||||||
//AddGroup(datatable, di.DocumentTitle, "", f2, false, new Color(0xC0, 0xFF, 0xC0)); // Library Document Title
|
|
||||||
AddGroup(subtable, di.DocumentTitle, "", f2, false, new Color(0xC0, 0xFF, 0xC0), false); // Library Document Title
|
AddGroup(subtable, di.DocumentTitle, "", f2, false, new Color(0xC0, 0xFF, 0xC0), false); // Library Document Title
|
||||||
if (di.DocumentConfig.LibDoc_Comment != null && di.DocumentConfig.LibDoc_Comment.Length > 0)
|
if (di.DocumentConfig.LibDoc_Comment != null && di.DocumentConfig.LibDoc_Comment.Length > 0)
|
||||||
{
|
{
|
||||||
//AddCell(datatable, "Comment", f2, AnnoBackgroundColor);
|
|
||||||
//AddCell(datatable, di.DocumentConfig.LibDoc_Comment, f2, AnnoBackgroundColor); // lib doc comment
|
|
||||||
AddCell(subtable, "Comment", f2, AnnoBackgroundColor);
|
AddCell(subtable, "Comment", f2, AnnoBackgroundColor);
|
||||||
AddCell(subtable, di.DocumentConfig.LibDoc_Comment, f2, AnnoBackgroundColor); // lib doc comment
|
AddCell(subtable, di.DocumentConfig.LibDoc_Comment, f2, AnnoBackgroundColor); // lib doc comment
|
||||||
}
|
}
|
||||||
if (di.DocumentEntries == null || di.DocumentEntries.Count == 0)
|
if (di.DocumentEntries == null || di.DocumentEntries.Count == 0)
|
||||||
{
|
{
|
||||||
//AddColSpanCell(datatable, "*No References To This Library Document", f2, NotUsedBackgroundColor, 2, Element.ALIGN_LEFT);
|
|
||||||
AddColSpanCell(subtable, "*No References To This Library Document", f2, NotUsedBackgroundColor, 2, Element.ALIGN_LEFT);
|
AddColSpanCell(subtable, "*No References To This Library Document", f2, NotUsedBackgroundColor, 2, Element.ALIGN_LEFT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -775,15 +624,9 @@ namespace Volian.Print.Library
|
|||||||
string ProcNumber = item.MyProcedure.ProcedureConfig.Number;
|
string ProcNumber = item.MyProcedure.ProcedureConfig.Number;
|
||||||
ProcNumber = ProcNumber.Replace(@"\u8209?", "-"); // repace unicode with dash char
|
ProcNumber = ProcNumber.Replace(@"\u8209?", "-"); // repace unicode with dash char
|
||||||
ProcNumber = ProcNumber.Replace(@"\u160?", " "); // replace Hard Space with normal Space
|
ProcNumber = ProcNumber.Replace(@"\u160?", " "); // replace Hard Space with normal Space
|
||||||
//if (item.SearchDVPath != lastDvPath)
|
|
||||||
// AddGroup(datatable, item.SearchDVPath, lastDvPath, f2, false, Color.LIGHT_GRAY);//new Color(0xC0, 0xFF, 0xC0));
|
|
||||||
//if (item.SearchDVPath != lastDvPath)
|
|
||||||
// AddSubPathGroup(datatable, item.SearchDVPath,splitAt, f2, Color.LIGHT_GRAY, 2);//new Color(0xC0, 0xFF, 0xC0));
|
|
||||||
if (item.SearchDVPath != lastDvPath)
|
if (item.SearchDVPath != lastDvPath)
|
||||||
AddSubPathGroup(subtable, item.SearchDVPath, splitAt, f2, Color.LIGHT_GRAY, 2);//new Color(0xC0, 0xFF, 0xC0));
|
AddSubPathGroup(subtable, item.SearchDVPath, splitAt, f2, Color.LIGHT_GRAY, 2);//new Color(0xC0, 0xFF, 0xC0));
|
||||||
lastDvPath = item.SearchDVPath;
|
lastDvPath = item.SearchDVPath;
|
||||||
//AddCell(datatable, ProcNumber, f2, TextBackgroundColor);
|
|
||||||
//AddCell(datatable, item.MyContent.Number + " - " + item.MyContent.Text, f2, TextBackgroundColor);
|
|
||||||
AddCell(subtable, ProcNumber, f2, TextBackgroundColor);
|
AddCell(subtable, ProcNumber, f2, TextBackgroundColor);
|
||||||
AddCell(subtable, item.MyContent.Number + " - " + item.MyContent.Text, f2, TextBackgroundColor);
|
AddCell(subtable, item.MyContent.Number + " - " + item.MyContent.Text, f2, TextBackgroundColor);
|
||||||
}
|
}
|
||||||
@ -794,7 +637,6 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
private void AddROUsages(ItemInfo item, Dictionary<string, List<ItemInfo>> roUse)
|
private void AddROUsages(ItemInfo item, Dictionary<string, List<ItemInfo>> roUse)
|
||||||
{
|
{
|
||||||
//string lastROid = "";
|
|
||||||
if (item.FoundROID != null && item.FoundROID != "")
|
if (item.FoundROID != null && item.FoundROID != "")
|
||||||
{
|
{
|
||||||
string roid = item.FoundROID;
|
string roid = item.FoundROID;
|
||||||
@ -820,16 +662,6 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
if (rotitle == "")
|
if (rotitle == "")
|
||||||
{
|
{
|
||||||
//ROFSTLookup myrofstlookup = itm.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup;
|
|
||||||
//List<string> roTitleList = myrofstlookup.GetROTitleAndGroupPath(roKey);
|
|
||||||
//for (int cnt = 0; cnt < roTitleList.Count; cnt++)
|
|
||||||
//{
|
|
||||||
// if (cnt == roTitleList.Count - 1)
|
|
||||||
// //rotitle += string.Format("<{0}> {1} {2}", myrofstlookup.GetRoACID(roKey), myrofstlookup.GetTranslatedRoValue(roKey, true), roTitleList[cnt]);
|
|
||||||
// rotitle += roTitleList[cnt];
|
|
||||||
// else
|
|
||||||
// rotitle += roTitleList[cnt] + "\n ";
|
|
||||||
//}
|
|
||||||
rotitle = GetROTitleAndGroup(roKey, itm);
|
rotitle = GetROTitleAndGroup(roKey, itm);
|
||||||
if (rotitle != null && rotitle != "")
|
if (rotitle != null && rotitle != "")
|
||||||
{
|
{
|
||||||
@ -840,7 +672,6 @@ namespace Volian.Print.Library
|
|||||||
ROTitleCell.BackgroundColor = Color.PINK;
|
ROTitleCell.BackgroundColor = Color.PINK;
|
||||||
else
|
else
|
||||||
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);
|
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);
|
||||||
//curTable.AddCell(ROTitleCell); // put RO value and description
|
|
||||||
rotable.AddCell(ROTitleCell); // put RO value and description
|
rotable.AddCell(ROTitleCell); // put RO value and description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -850,9 +681,6 @@ namespace Volian.Print.Library
|
|||||||
stepnum = itm.MyActiveSection.DisplayNumber;
|
stepnum = itm.MyActiveSection.DisplayNumber;
|
||||||
else
|
else
|
||||||
stepnum = BuildStepTab(itm);//GetStepNumberFromSearchPath(itm.SearchPath);//stepnum.Substring(itm.SearchPath.LastIndexOf(sectitle) + sectitle.Length +1);
|
stepnum = BuildStepTab(itm);//GetStepNumberFromSearchPath(itm.SearchPath);//stepnum.Substring(itm.SearchPath.LastIndexOf(sectitle) + sectitle.Length +1);
|
||||||
// stepnum = stepnum.Substring(stepnum.LastIndexOf("\a") + 1);
|
|
||||||
//AddCell(curTable, stepnum, f2, Color.WHITE);
|
|
||||||
//AddCell(curTable, itm.DisplayText, f2, Color.WHITE);
|
|
||||||
AddCell(rotable, stepnum, f2, Color.WHITE);
|
AddCell(rotable, stepnum, f2, Color.WHITE);
|
||||||
AddCell(rotable, itm.DisplayText, f2, Color.WHITE);
|
AddCell(rotable, itm.DisplayText, f2, Color.WHITE);
|
||||||
}
|
}
|
||||||
@ -905,7 +733,6 @@ namespace Volian.Print.Library
|
|||||||
return thisTab;
|
return thisTab;
|
||||||
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;//stpinfo.FormatStepData.ToString();
|
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;//stpinfo.FormatStepData.ToString();
|
||||||
// remove delimiters of '.' and ')' in tab.
|
// remove delimiters of '.' and ')' in tab.
|
||||||
//if (thisTab != null && !hasDelim)
|
|
||||||
if (thisTab != null)
|
if (thisTab != null)
|
||||||
{
|
{
|
||||||
// get list of delimiters to remove from the format:
|
// get list of delimiters to remove from the format:
|
||||||
@ -938,7 +765,6 @@ namespace Volian.Print.Library
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
thisTab = thisTab.Trim(" ".ToCharArray());
|
thisTab = thisTab.Trim(" ".ToCharArray());
|
||||||
//sret = "." + thisTab + " " + pitem.Ordinal.ToString() + sret;
|
|
||||||
sret = thisTab + " " + pitem.Ordinal.ToString() + sret;
|
sret = thisTab + " " + pitem.Ordinal.ToString() + sret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -947,12 +773,10 @@ namespace Volian.Print.Library
|
|||||||
if (thisTab != "")
|
if (thisTab != "")
|
||||||
{
|
{
|
||||||
thisTab = thisTab.Trim(" ".ToCharArray());
|
thisTab = thisTab.Trim(" ".ToCharArray());
|
||||||
//if (hasDelim && !thisTab.EndsWith(".") && !thisTab.EndsWith(")")) thisTab = thisTab + ".";
|
|
||||||
if (!thisTab.EndsWith(".") && !thisTab.EndsWith(")")) thisTab = thisTab + ".";
|
if (!thisTab.EndsWith(".") && !thisTab.EndsWith(")")) thisTab = thisTab + ".";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
thisTab = "{" + typeName + " " + pitem.Ordinal.ToString() + "}.";
|
thisTab = "{" + typeName + " " + pitem.Ordinal.ToString() + "}.";
|
||||||
//sret = "." + thisTab + sret;
|
|
||||||
sret = thisTab + sret;
|
sret = thisTab + sret;
|
||||||
}
|
}
|
||||||
pitem = pitem.ActiveParent as ItemInfo;
|
pitem = pitem.ActiveParent as ItemInfo;
|
||||||
@ -964,16 +788,13 @@ namespace Volian.Print.Library
|
|||||||
StepInfo stpinfo = StepInfo.Get(pitem.ItemID);
|
StepInfo stpinfo = StepInfo.Get(pitem.ItemID);
|
||||||
|
|
||||||
string hlsTab = stpinfo.MyTab.CleanTextNoSymbols; //StepInfo.Get(pitem.ItemID).MyTab.CleanTextNoSymbols;
|
string hlsTab = stpinfo.MyTab.CleanTextNoSymbols; //StepInfo.Get(pitem.ItemID).MyTab.CleanTextNoSymbols;
|
||||||
//string thisTab = stpinfo.MyTab.CleanText; //StepInfo.Get(pitem.ItemID).MyTab.CleanText;
|
|
||||||
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;//stpinfo.FormatStepData.GetPDDisplayName(); //.ToString();
|
string typeName = stpinfo.FormatStepData.StepEditData.TypeMenu.MenuItem;//stpinfo.FormatStepData.GetPDDisplayName(); //.ToString();
|
||||||
if (hlsTab == null || hlsTab == "")
|
if (hlsTab == null || hlsTab == "")
|
||||||
hlsTab = "{" + typeName + " " + pitem.Ordinal.ToString() + "}.";
|
hlsTab = "{" + typeName + " " + pitem.Ordinal.ToString() + "}.";
|
||||||
else if (!sret.StartsWith(hlsTab.Trim(" ".ToCharArray())))
|
else if (!sret.StartsWith(hlsTab.Trim(" ".ToCharArray())))
|
||||||
{
|
{
|
||||||
//if (!hasDelim)
|
|
||||||
foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, "");
|
foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, "");
|
||||||
hlsTab = hlsTab.Trim(" ".ToCharArray());
|
hlsTab = hlsTab.Trim(" ".ToCharArray());
|
||||||
//if (hasDelim && !hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + ".";
|
|
||||||
if (!hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + ".";
|
if (!hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + ".";
|
||||||
}
|
}
|
||||||
sret = hlsTab + sret;
|
sret = hlsTab + sret;
|
||||||
@ -1024,7 +845,6 @@ namespace Volian.Print.Library
|
|||||||
AddCell(colHeader, "Text", f2, subHeaderColor);
|
AddCell(colHeader, "Text", f2, subHeaderColor);
|
||||||
datatable.AddCell(colHeader);
|
datatable.AddCell(colHeader);
|
||||||
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
|
datatable.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
|
||||||
//string lastPath = "";
|
|
||||||
Color AnnoColor = new Color(0xFF, 0xFF, 0xC0);
|
Color AnnoColor = new Color(0xFF, 0xFF, 0xC0);
|
||||||
Color TextColor = Color.WHITE;
|
Color TextColor = Color.WHITE;
|
||||||
Color SectColor = new Color(0xE0, 0xFF, 0xE0);//new Color(0xC0, 0xFF, 0xC0);//Color.LIGHT_GRAY;
|
Color SectColor = new Color(0xE0, 0xFF, 0xE0);//new Color(0xC0, 0xFF, 0xC0);//Color.LIGHT_GRAY;
|
||||||
@ -1190,7 +1010,6 @@ namespace Volian.Print.Library
|
|||||||
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
|
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
|
||||||
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
|
PdfPCell cell = new PdfPCell(new Phrase(ReportTitle, f1));
|
||||||
cell.HorizontalAlignment = Element.ALIGN_CENTER;
|
cell.HorizontalAlignment = Element.ALIGN_CENTER;
|
||||||
//cell.Colspan = 2;
|
|
||||||
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light blue
|
cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light blue
|
||||||
datatable.AddCell(cell);
|
datatable.AddCell(cell);
|
||||||
|
|
||||||
@ -1266,8 +1085,6 @@ namespace Volian.Print.Library
|
|||||||
}
|
}
|
||||||
private System.Collections.ArrayList GetSortedItemInfoList(ItemInfoList orgIFL)
|
private System.Collections.ArrayList GetSortedItemInfoList(ItemInfoList orgIFL)
|
||||||
{
|
{
|
||||||
//ICollection<ItemInfo> rtnIFL;
|
|
||||||
//get list of different procedure sets
|
|
||||||
System.Collections.ArrayList libDocProcSetList = new System.Collections.ArrayList();
|
System.Collections.ArrayList libDocProcSetList = new System.Collections.ArrayList();
|
||||||
System.Collections.ArrayList rtnIFL = new System.Collections.ArrayList();
|
System.Collections.ArrayList rtnIFL = new System.Collections.ArrayList();
|
||||||
foreach (ItemInfo item in orgIFL)
|
foreach (ItemInfo item in orgIFL)
|
||||||
@ -1288,18 +1105,14 @@ namespace Volian.Print.Library
|
|||||||
|
|
||||||
private void BuildCompleteROReport(iTextSharp.text.Document document)
|
private void BuildCompleteROReport(iTextSharp.text.Document document)
|
||||||
{
|
{
|
||||||
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
CompleteROReport compRORpt = new CompleteROReport(_MyPdfWriter, document,_RODataFile, _ConvertCaretToDelta, _IncludeEmptyROFields);
|
||||||
iTextSharp.text.Font f2 = pdf.GetFont("Arial Unicode MS", 10, 0, Color.BLACK);
|
compRORpt.F10 = pdf.GetFont("Courier New", 10, 0, Color.BLACK);
|
||||||
iTextSharp.text.Font f3 = pdf.GetFont("Arial Unicode MS", 12, 0, Color.BLACK);
|
compRORpt.F10Bold = pdf.GetFont("Courier New", 10, 1, Color.BLACK);
|
||||||
|
compRORpt.F12 = pdf.GetFont("Courier New", 12, 0, Color.BLACK);
|
||||||
iTextSharp.text.Font fntBold = new Font(f3.BaseFont, f3.Size, Font.BOLD, Color.RED);
|
compRORpt.F12Bold = pdf.GetFont("Courier New", 12, 1, Color.BLACK);
|
||||||
CompleteROReport compRORpt = new CompleteROReport(document, _RODataFile);
|
compRORpt.F14 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
||||||
|
compRORpt.ROFstID = _ROFSTLookup.MyDocVersionInfo.DocVersionAssociations[0].MyROFst.ROFstID;
|
||||||
compRORpt.Run();
|
compRORpt.Run();
|
||||||
|
|
||||||
Phrase phrs = BuildPhrase2("Complete Referenced Objects Report", f1, fntBold);
|
|
||||||
Paragraph prgh = new Paragraph(phrs);//("Complete", fntBold);
|
|
||||||
//document.Add(prgh);
|
|
||||||
document.Add(phrs);
|
|
||||||
}
|
}
|
||||||
private string GetROTitleAndGroupsForSummary(List<string>roTitleList, List<string> prevROTitleList)
|
private string GetROTitleAndGroupsForSummary(List<string>roTitleList, List<string> prevROTitleList)
|
||||||
{
|
{
|
||||||
@ -1333,7 +1146,7 @@ namespace Volian.Print.Library
|
|||||||
cell.FollowingIndent = 72;
|
cell.FollowingIndent = 72;
|
||||||
cell.Colspan = 2;
|
cell.Colspan = 2;
|
||||||
cell.BorderColor = Color.WHITE;
|
cell.BorderColor = Color.WHITE;
|
||||||
cell.BackgroundColor = Color.WHITE;//bgColor;
|
cell.BackgroundColor = Color.WHITE;
|
||||||
cell.BorderWidthTop = 1;
|
cell.BorderWidthTop = 1;
|
||||||
datatable.AddCell(cell);
|
datatable.AddCell(cell);
|
||||||
}
|
}
|
||||||
@ -1346,7 +1159,6 @@ namespace Volian.Print.Library
|
|||||||
cell.BorderColor = Color.WHITE;
|
cell.BorderColor = Color.WHITE;
|
||||||
cell.Colspan = 2;
|
cell.Colspan = 2;
|
||||||
cell.BackgroundColor = bgColor;
|
cell.BackgroundColor = bgColor;
|
||||||
//cell.BorderWidthTop = 1;
|
|
||||||
datatable.AddCell(cell);
|
datatable.AddCell(cell);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1355,9 +1167,6 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
float[] headerwidths = { 10, 20, 80 };
|
float[] headerwidths = { 10, 20, 80 };
|
||||||
PdfPTable datatable = new PdfPTable(1);
|
PdfPTable datatable = new PdfPTable(1);
|
||||||
PdfPTable colHeader = new PdfPTable(headerwidths);
|
|
||||||
PdfPTable databaseTitle = new PdfPTable(1);
|
|
||||||
//datatable.FooterRows = 1;
|
|
||||||
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
|
datatable.TotalWidth = document.PageSize.Width - document.LeftMargin - document.RightMargin;
|
||||||
datatable.LockedWidth = true;
|
datatable.LockedWidth = true;
|
||||||
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
iTextSharp.text.Font f1 = pdf.GetFont("Arial Unicode MS", 14, 1, Color.BLACK);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user