Repeat First Table Row


#1

Is there a way to repeat the first row of a table on each subsequent
page? Most tables produced by our reporting products have a
column header row that needs to be rendered on each page of the Word
export. I’m not sure this will be possible until you add better
pagination support to Aspose.Word but it’s definitely needed.



Thanks, Natan.


#2

Hi,

Thank you for your interest in Aspose.Word.

Did you try to set RowFormat.HeadingFormat to true for that row?


#3

I tried that but it doesn’t work. I thought the pointer was probably in the wrong place but I think this is right:



DocumentBuilder.StartTable()

DocumentBuilder.InsertCell()

If (isFirstRow) Then DocumentBuilder.RowFormat.HeadingFormat = True



I think that should work.


#4

Do you have any thoughts on this matter?


#5

Please post the whole fragment of code which you use for building the table.


#6

I’ve attached the source file. You’ll want to look at the large case statement, specifically:



Case “TABLE”

Case “TR”

Case “TD”, “TH”



I’m designating a header row on Ln 355.



Thanks, Natan.


#7

Thanks for the attachment. I think you should also switch heading format off by setting it to false when the row being processed is not supposed to be repeated on every page.


#8

That worked! Thanks.



Does heading format work for nested tables?


#9

Although I can hardly imagine how a nested table row might be supposed to be repeated on each page, setting this property is fully equivalent to setting the corresponding property in Word so if it is possible in Word, it will work using Aspose.Word, too.