I have a problem with boolean set by event.
private void HandlePageStart(Document document, PdfWriter writer)
{
ItemsTableColumnHeadersInsertNeeded = true;
Console.WriteLine("Page started");
}
The HandlePageStart function is fired by event and it works just fine and sets boolean to true. However if statement running in the loop in another function doesn't work and the code inside the if statement is never executed.
private void AddItemsToTable(Invoice inv, PdfPTable table)
{
foreach (InvoiceItem item in inv.Items)
{
...add content to page...
if (ItemsTableColumnHeadersInsertNeeded)
{
AddItemsTableColumnsHeaders(table);
ItemsTableColumnHeadersInsertNeeded = false;
}
}
}
Aucun commentaire:
Enregistrer un commentaire