开发者

iTextSharp error : infinite table loop : row content is larger than page

开发者 https://www.devze.com 2023-03-18 05:43 出处:网络
I\'m trying to add content from my database to a table I created with iTextSharp but I get this error:

I'm trying to add content from my database to a table I created with iTextSharp but I get this error:

>infinite table loop : row content is larger than page 

Here is my code:

foreach (string n in Data)
                {
                    PdfPCell cella = new PdfPCell(new Phrase(n.id.ToString()));
                    table.AddCell(cella);
                    PdfPCell cellb = new PdfPCell(new Paragraph(n.Valeur));
                    table.AddCell(cellb);
                    PdfPCell cellc = new PdfPCell(new Phrase(n.Titre));
                    table.AddCell(cellc);
                }

            table.SpacingAfter = 40f开发者_如何转开发;
            document.Add(table);

Its the n.Valeur that causing the problem although its content is not that big, mainly a paragraph.


added this settings table and it solved it for me partially

table.SplitLate = false; 
table.SplitRows = true;


It's happens when the bug object's (n.Valeur) width or height is more than a page (eg:A4). You must reduce the width or height.

0

精彩评论

暂无评论...
验证码 换一张
取 消