B2022-111: Approval/Summary of changes has “Error Argument out of Range Exception

This commit is contained in:
Kathy Ruffing 2022-11-07 14:22:42 +00:00
parent 7f683c98ce
commit 6e3d3043d7

View File

@ -1502,6 +1502,7 @@ namespace Volian.Print.Library
if (cai.Type == 20008)
{
GridAuditInfoList gail = GridAuditInfoList.Get(cai.ContentID);
bool addedInfo = false;
if (gail.Count > 0)
{
GridAuditInfo gai = gail[0];
@ -1513,20 +1514,30 @@ namespace Volian.Print.Library
PdfPTable gtbl = new PdfPTable(gcols);
while (data.Length > 0)
{
string val = data.Substring(0, data.IndexOf(";"));
data = data.Substring(data.IndexOf(";") + 1);
Phrase hh = new Phrase();
hh.Font = f4;
hh.Add(val);
PdfPCell cc = new PdfPCell(hh);
gtbl.AddCell(cc);
int indx = data.IndexOf(";"); // B2022-111: error on summary report (data missing ';' so couldn't parse out report info)
if (indx > 0)
{
addedInfo = true;
string val = data.Substring(0, data.IndexOf(";"));
data = data.Substring(data.IndexOf(";") + 1);
Phrase hh = new Phrase();
hh.Font = f4;
hh.Add(val);
PdfPCell cc = new PdfPCell(hh);
gtbl.AddCell(cc);
}
else
data = ""; // couldn't find separator ';', don't continue to loop
}
if (addedInfo)
{
c = new PdfPCell(gtbl);
c.Colspan = cols - 4;
c.HorizontalAlignment = Element.ALIGN_LEFT;
//c.PaddingBottom = paddingBottom;
//c.Border = borders;
t.AddCell(c);
}
c = new PdfPCell(gtbl);
c.Colspan = cols - 4;
c.HorizontalAlignment = Element.ALIGN_LEFT;
//c.PaddingBottom = paddingBottom;
//c.Border = borders;
t.AddCell(c);
}
// B2017-058: The following was added to handle when there are no grid audits, just put a message. Without
// adding this cell to the output, the columns get out of sync for rest of report.