PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 10:39 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Oct 19, 2010 11:49 am 
Offline

Joined: Tue Oct 19, 2010 11:40 am
Posts: 1
Hi,

I have code like this:
Code:
                        int i = 0;

                        if (dateRanges.Any())
                        {
                            // Document:
                            section.AddParagraph();
                            section.AddParagraph("Audit trail by date").Format.Font.Bold = true;
                            section.AddParagraph();
                            var table = section.AddTable();
                            table.Style = "Table";
                            table.Borders.Width = 0.25;
                            var c = table.AddColumn();
                            c.Format.Alignment = ParagraphAlignment.Left;
                            c.Width = Unit.FromCentimeter(18);

                            // Audit trail by date report:
                            foreach (string daterange in dateRanges)
                            {
                                ....

                                // Construct document table rows:
                                var row = table.AddRow();
                                row.HeadingFormat = true;
                                row.Format.Font.Bold = true;
                                row[0].AddParagraph(daterange + " " + i); i++; ----- BREAKPOINT HERE

                                var row2 = table.AddRow();
                                Cell cell = row2[0];

The int i declaration is there just to debug this issue.

The problem is that although I loop through this 3 times I get 4 date range rows.

The PDF comes out like this:

Daterange string 0
Data

Daterange string 1
Daterange string 0
Data

Daterange string 2
Data

I hit the breakpoint 3 times. The final value of i is 2. But I have 4 rows containing a daterange string.

At my wits end on this and conclude it may be a bug in the library?

Can supply full code and generated PDF by PM but can't post in the open as the code belongs to my employer.

Any help would be much appreciated!

Steve


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 374 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group