Hi @asad.ali
After some analysis, we found that below method is creating issues with high volume of records in pdf files.
Purpose of method is, read each row from collection (grid) and perform right alignment for numbers and left alignment for remaining data types and insert into pdf(table).
Can you please check if this is correct way or we can have some better solution ??
Code Snippet:
Table tab = new Table();
TextState tr = new TextState();
TextState tl = new TextState();
tr.setHorizontalAlignment(HorizontalAlignment.Right);
tl.setHorizontalAlignment(HorizontalAlignment.Left);
// Variables Info
// grid : holds 50000 rows.
// colValueType : hold info about columns if that is number or string type data.
/data insertion part/
for (ArrayList onerow : grid)
{
i = 0;
orderkeys =1;
Row rowt = tab.getRows().add();
rowt.setVerticalAlignment(1);
for (Object obj : onerow)
{
if (i > MAX_PDF_COLS)
{
i = 0;
break;
}
// Data Insert with Alignment
if(colValueType.get(orderkeys).equalsIgnoreCase(“number”))
{
rowt.getCells().add(obj.toString(), tr);
}
else
{
rowt.getCells().add(obj.toString(), tl);
}
i++;
orderkeys++;
}
}
Thanks in advance.