Questions on inserting a dynamic table into Word


I am using Aspose.Words with C# and have 2 questions.

1. What is the recommendation for using InsertHTML?

I need to write a resultset/table of up to 1000 rows into a Word file. The nubmer of columns is also dynamic and can be up to 10. I first tried InsertHTML which worked fine until the number of rows gets big -- it seems to use excessive CPU time when inserting a long HTML string/table manually generated via StringBuilder by looping through the records.

2. How can I make a dynamically generated template table to have its first row to "Repeat as header row at the top of each page"?

To avoid the perfomance issue above, I tried to programatically create a Word doc with a template table which has its cells inserted dynamically. The cells are then populated with merge fields on the fly and bound to the columns of a DataTable. But I couldn't find the method/property to set the table header to repeat on every new page.

Thanks in advance for your help.



To set the first row to "Repeat as header row at the top of each page" use RowFormat.HeadingFormat property.

Concerning InsertHtml recommendations I need to see your code to make recomendations on how to optimize it for speed. Please provide some code and/or HTML examples illustrating your problem.