I'm generating pdf with Spire.Doc (https://ibb.co/6sW9cjk). In different sub that code works nicely, but when copied to another sub (will provide the same functionallity as original one) code breaks.
Simple:
Everything is initialized properly, doc
is using existing doc file as template to fill it with data.
Today I noticed that even original code is not working! Same error, NullReferenceException
when adding second row to table.
If I do like this:
dri.Cells(0).AddParagraph()
dri.Cells(0).FirstParagraph.Text = itemsInReceiptCount
Code works but data is not in table row but under the table. (https://ibb.co/y06nnpP)
Is there any cool fix? Everything was working fine until (???).
Well, I figured it out.
Somehow code like I mentioned in question doesnt work, but (!) if I did it like that:
For Each i As TableCell In dri.Cells
i.AddParagraph()
Next
Code will work, table will generate properly (but without borders - easily fixable), paragraphs can be filled with data, no exceptions or errors.
So, I think if it works, it will stay like this.