Repeat Table Header

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Re: Repeat Table Header

DynamicPDF CoreSuite for .NET (v7) Forum

 Jul 20 2018 8:33 AM
DynamicPDF for Net
dll File version 7.0.2.40

I am using the following code to create a table with a header to be repeated on each overflow page.
            docketTable.Columns.Add(125);
            docketTable.Columns.Add(371);
            docketTable.Columns[0].CellDefault.Align = TextAlign.Left;
            docketTable.Columns[1].CellDefault.Align = TextAlign.Left;
            docketTable.Border.LineStyle = LineStyle.None;
            docketTable.CellDefault.Border.LineStyle = LineStyle.None;
            Row2 row = docketTable.Rows.Add(20, ceTe.DynamicPDF.Font.TimesRoman, 12);
            row.Cells.Add("Date");
            row.Cells.Add("Docket Description/Text");
            row.Cells[0].Underline = true;
            row.Cells[1].Underline = true;
            docketTable.RepeatRowHeaderCount = 1;
           
            foreach(AppealData.caseDocket d in docket)
            {
                Row2 rowx = docketTable.Rows.Add(ceTe.DynamicPDF.Font.TimesRoman, 12);
                rowx.Cells.Add(d.date, 1);
                rowx.Cells.Add(d.text, 1);
            }
An this code to produce the pdf pages with the overflow table.
                    if(docketTable != null)
                    {
                        do
                        {
                            ceTe.DynamicPDF.Page newpage = new ceTe.DynamicPDF.Page(dimensions);
                            CurrentPDF.doc.Pages.Add(newpage);
                            newpage.Elements.Add(docketTable);
                            docketTable = docketTable.GetOverflowRows();
                        } while (docketTable != null);
                    }
My problem is that while the correct number of pages are produced, it is only the first page repeated. Meaning that if 10 pages are produced, all 10 pages contain the exact same data. If I remove the docketTable.RepeatRowHeaderCount = 1; line of code then I get the 10 pages as expected but with the header line on the first page only.

What am I missing?


 Jul 26 2018 9:34 AM
Posted by a ceTe Software moderator
Hello,

If you would like to repeat the first row of the table on each page of the PDF then you will need to set the RepeatColumnHeaderCount of  Table2 object to value 1 instead of setting RepeatRowHeaderCount. Below is the code sample.

                 docketTable.RepeatColumnHeaderCount = 1;

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 5:10 AM.