Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Header row not repeating in table created with putdocx table

    I have been experimenting with formatting tables using putdocx table. I have a dataset with 514 observations (districts) and am required to present some data in supplementary tables for every district. (Ours is not to reason why. For the benefit of potential re-users, I will also provide the data in excel format.)

    The tables run over several pages; the least I can do is try to make them more readable by repeating the two header rows on every page. This was working in an earlier version of the code, when I was using just one header row, and varnames:


    Code:
    putdocx table tablea =  data(var1 var3 var3), varnames headerrow(1)
    Now I have added another line and prettied up the column headings, and the headerrow is no longer repeating

    Code:
    putdocx table tablea =  data(var1 var3 var3 var8),headerrow(2) layout(autofitcontents)
    putdocx table tablea(1,.), addrows(2,before)
    putdocx table tablea(1,4) = ("% reporting"), colspan(4) halign(center)
    putdocx table tablea(2,1)=("District"),
    putdocx table tablea(2,2) = ("Province"),
    This produces the output I expect on the first page, but does not repeat it on subsequent pages.
    I'd appreciate help spotting my error. Thanks.
Working...
X