B2022-079: Error printed on Chronology of Changes report

This commit is contained in:
Kathy Ruffing 2022-07-28 13:08:45 +00:00
parent 6dff9463ad
commit 8b21a92729

View File

@ -345,6 +345,7 @@ namespace Volian.Print.Library
if (cai.Type == 20008) if (cai.Type == 20008)
{ {
GridAuditInfoList gail = GridAuditInfoList.Get(cai.ContentID); GridAuditInfoList gail = GridAuditInfoList.Get(cai.ContentID);
bool addedInfo = false;
if (gail.Count > 0) if (gail.Count > 0)
{ {
GridAuditInfo gai = gail[0]; GridAuditInfo gai = gail[0];
@ -356,22 +357,31 @@ namespace Volian.Print.Library
PdfPTable gtbl = new PdfPTable(gcols); PdfPTable gtbl = new PdfPTable(gcols);
while (data.Length > 0) while (data.Length > 0)
{ {
string val = data.Substring(0, data.IndexOf(";")); int indx = data.IndexOf(";"); // B2022-079: error on chronology report (data missing ';' so couldn't parse out report info)
data = data.Substring(data.IndexOf(";") + 1); if (indx > 0)
Phrase hh = new Phrase(); {
hh.Font = f4; addedInfo = true;
hh.Add(val); string val = data.Substring(0, data.IndexOf(";"));
PdfPCell cc = new PdfPCell(hh); data = data.Substring(data.IndexOf(";") + 1);
gtbl.AddCell(cc); 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 added info above, i.e. no error, put out the cell
if (addedInfo)
{
c = new PdfPCell(gtbl);
c.Colspan = cols - 4;
c.HorizontalAlignment = Element.ALIGN_LEFT;
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);
} }
else if (!addedInfo) // Didn't add info, report that data not available
{ {
h = new Phrase(); h = new Phrase();
h.Font = f4; h.Font = f4;