B2022-093 Added a message on the RO Usage Report when no RO usages are found.

This commit is contained in:
John Jenko 2022-09-01 14:25:13 +00:00
parent 59a5f20310
commit 9c6a4c93dc

View File

@ -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);
}