Page 1 of 1
How to achieve something similar to Word’s “Keep with next”
Posted: Tue Jun 02, 2026 10:08 am
by dua
Hello,
I need advice on how to achieve something similar to Word’s “Keep with next” in Stimulsoft Reports - WEB.
I have a report structure like this:
DataBand1: contains the table header
DataBand2: contains detail data (repeating rows from a datasource loop)
I need to ensure that DataBand1 (table header) is never printed at the bottom of a page without at least one row from DataBand2 following it. In other words, if the header fits at the end of a page but there isn’t enough space for at least one detail row, both should move to the next page.
Thank you in advance!
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Tue Jun 02, 2026 10:08 pm
by Lech Kulikowski
Hello,
Try to use the KeepDetails property for the detail band.
Thank you.
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Wed Jun 03, 2026 7:22 am
by dua
Hello,
Thank you for the suggestion.
Unfortunately, KeepDetails does not solve my issue. The problem is that the table header band can still be rendered at the bottom of a page without any detail rows following it.
I know that normally, the report template is stored in an .mrt file. However, in our solution the template is embedded inside a larger XML structure together with additional data sources and supporting configuration.
To make the issue reproducible while avoiding unrelated implementation details, I extracted only the <Data> element that contains the report definition and removed our custom additions.
Please let me know if this format is sufficient for your investigation.
Thank you.
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Fri Jun 05, 2026 9:37 am
by Lech Kulikowski
Hello,
We require more time to investigate the issue thoroughly. Rest assured, we will keep you informed about the outcome as soon as possible.
Thank you.
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Mon Jun 08, 2026 10:47 am
by dua
Hello,
Thank you for the update. I appreciate you taking the time to investigate this issue.
In the meantime, I have tried a few alternative approaches:
First, I moved both the table header and detail data into a single DataBand and configured the header to be displayed only for the first row. However, while this displays the header correctly, I was unable to eliminate the empty space that remains when the header is not rendered.
I also experimented with placing the header in the DataBand and rendering the detail rows through a Sub-Report, but unfortunately this approach did not solve the problem either.
Thank you.
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Thu Jun 11, 2026 2:45 pm
by Lech Kulikowski
Hello,
In this case, you need to set the MasterComponent=DataBand1 for the detail band and set KeepDetails=Keep First Detail Together
Thank you.
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Fri Jun 12, 2026 9:40 am
by dua
Hello,
Thank you very much for your help and for investigating this issue.
I tested the solution, and it works correctly in my scenario. It is suitable for my requirements and resolves the problem I was facing.
I appreciate the time and effort you dedicated to analyzing the sample and providing a solution.
Thank you again for your support.
Re: How to achieve something similar to Word’s “Keep with next”
Posted: Fri Jun 12, 2026 10:02 pm
by Lech Kulikowski
Hello,
You are welcome.
We are always glad to help you!