I want to write code to generate reports in MS Word. The data to print in the word doc comes from the database. The data is in the form of sessions and the comments of the attendees against those sessions. In a sesnse, it is a master detail relationship between sessions and their comments.
The program would print session related information(say session name, venue and number of attendees) using a particular style, below which there will be a bulleted list of comments for that session. The number of comments under each session is dynamic and if the comments do not fit in a page, need is to repeat the session related information on the next page, followed by the remaining comments. The comments for a particular session could potentially last several pages and so the session related information should print at the top of the page before the remaining comments start to print.
I have not been able to determine at what point the comments of the same session start spilling over to the next page so that I can print the session related information before printing the remaining comments.
Can someone guide me on how to achieve this?