3
I’m doing the reports using iTextsharp and the result has been acceptable, but working with many records has become slow. Currently I do so:
I capture the database data (storing in a DataTable
);
In a foreach
concateno all in one string: (ex tosco)
foreach (DataRow row in FaturamentoCorpo.Rows)
stringao += row["ncodigfilia"].ToString()
At the end game for iTextsharp this "stringão":
Paragraph paragrafo = new Paragraph("", new Font(Font.FontFamily.COURIER, FontSize));
paragrafo.Add(stringao);
So this loop concatenating into the string, when the DataTable
has ai +- 10k records, resulting in a PDF of 70 to 80 pages, it is kind of time consuming.
So I wanted a better way to work that?
have tried:
foreach (DataRow row in FaturamentoCorpo.Rows)
 paragrafo.Add(row["ncodigfilia"].ToString());
? even if it is not in the same format, just to check the performance ?!– Rovann Linhalis
His comment was simple, but punctual, which complementing with the following answer I managed to solve the problem. Thank you very much.
– Magno Costa