From 9c6a4c93dccf4efccc507c5868f3fbdb19d8371e Mon Sep 17 00:00:00 2001 From: John Date: Thu, 1 Sep 2022 14:25:13 +0000 Subject: [PATCH] B2022-093 Added a message on the RO Usage Report when no RO usages are found. --- PROMS/Volian.Print.Library/PDFReport.cs | 90 ++++++++++++++----------- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git a/PROMS/Volian.Print.Library/PDFReport.cs b/PROMS/Volian.Print.Library/PDFReport.cs index 81e42447..05772373 100644 --- a/PROMS/Volian.Print.Library/PDFReport.cs +++ b/PROMS/Volian.Print.Library/PDFReport.cs @@ -1075,57 +1075,65 @@ namespace Volian.Print.Library string lastProcNum = string.Empty; string lastSection = string.Empty; string lastDVPath = string.Empty; - - foreach (ItemInfo item in _ResultList) + if (_ResultList.Count > 0) { - bool differentProcSet = false; - bool differentRO = false; - // Check Doc Version path - // if more than one procedure set is in the report data, then - // we will output the procedure set title inside the grouping of each RO - // otherwise, if we are reporting on only one procedure set, print the - // procedure set title at the top of the report (once). - if (lastDVPath != "" && lastDVPath != item.SearchDVPath) + foreach (ItemInfo item in _ResultList) { - subTable = new PdfPTable(headerwidths); - AddMainPathGroup(datatable, item.SearchDVPath, splitAt, f2, Color.LIGHT_GRAY, 0); - lastProcNum = string.Empty; - lastSection = string.Empty; - } - - lastDVPath = item.SearchDVPath; - //check for different procedure number - string curProcNum = GetCurProcNum(item.SearchPath); - string curSection = GetCurSectionNumTitle(item); - - if (!string.IsNullOrEmpty(lastProcNum) && (curProcNum != lastProcNum)) - { - if (roUse.Count > 0) + bool differentProcSet = false; + bool differentRO = false; + // Check Doc Version path + // if more than one procedure set is in the report data, then + // we will output the procedure set title inside the grouping of each RO + // otherwise, if we are reporting on only one procedure set, print the + // procedure set title at the top of the report (once). + if (lastDVPath != "" && lastDVPath != item.SearchDVPath) { - PutROusageForProcedure(datatable, roUse, headerwidths); - roUse.Clear(); + subTable = new PdfPTable(headerwidths); + AddMainPathGroup(datatable, item.SearchDVPath, splitAt, f2, Color.LIGHT_GRAY, 0); + lastProcNum = string.Empty; + lastSection = string.Empty; } - lastSection = string.Empty; - } + lastDVPath = item.SearchDVPath; + //check for different procedure number + string curProcNum = GetCurProcNum(item.SearchPath); + string curSection = GetCurSectionNumTitle(item); - if (!string.IsNullOrEmpty(lastSection) && (curSection != lastSection)) - { - if (roUse.Count > 0) + if (!string.IsNullOrEmpty(lastProcNum) && (curProcNum != lastProcNum)) { - PutROusageForProcedure(datatable, roUse, headerwidths); - roUse.Clear(); + if (roUse.Count > 0) + { + PutROusageForProcedure(datatable, roUse, headerwidths); + roUse.Clear(); + } + + lastSection = string.Empty; } + + if (!string.IsNullOrEmpty(lastSection) && (curSection != lastSection)) + { + if (roUse.Count > 0) + { + PutROusageForProcedure(datatable, roUse, headerwidths); + roUse.Clear(); + } + } + + AddROUsages(item, roUse); // add the used ro to the list for this procedure + AddProcedureSectionGroup(datatable, curProcNum, lastProcNum, curSection, lastSection, f2, new Color(0xC0, 0xFF, 0xC0)); + + lastProcNum = curProcNum; + lastSection = curSection; } - - AddROUsages(item, roUse); // add the used ro to the list for this procedure - AddProcedureSectionGroup(datatable, curProcNum, lastProcNum, curSection, lastSection, f2, new Color(0xC0, 0xFF, 0xC0)); - - lastProcNum = curProcNum; - lastSection = curSection; } - - PutROusageForProcedure(datatable, roUse, headerwidths); + else + { // B2022-093 put out a message if no RO Usages were found + cell = new PdfPCell(new Phrase("No RO Usage Information Found", f3)); + cell.HorizontalAlignment = Element.ALIGN_LEFT; + //cell.BackgroundColor = new Color(0xD0, 0xF0, 0xF0); // light blue + datatable.AddCell(cell); + } + PutROusageForProcedure(datatable, roUse, headerwidths); document.Add(datatable); }