I am using Aspose LINQ Reporting to generate word document. and the word template shows as below what i want is:
- When the amount of data is less than the number of rows in the table, will add blank column with description blank below.
- When the amount of data is greater than the number of rows in the table, will automatically starts a new page with header and footer
I am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.
I am afraid there is no direct way to achieve what you need. You can put table header into the document header and table footer into the document footer.
NOTE: In MS word table cannot be the last node of the story (body, header or footer) and there is always empty paragraph after table. So to avoid empty space after the footer you can decrease font size of the empty paragraph:
This will allow to repeat table footer and header on each page of the report. But since MS Word documents are flow by their nature there is no concept of page and there is no direct way to determine whether there is empty space on the page. Aspose.Words has it's own layout engine and using LayoutCollector and LayoutEnumerator to calculate empty space after the table. This will allow to add empty rows to the table after building the report. For example see the following code:
Here is result: