A recent XML Publisher report of mine printed a blank page at the end of the report anytime the final page was close to full. The culprit was extra blank spacer lines that were being added even though the content the lines surrounded was not included from the report.
Here's what the report looked like:
...content...
{blank spacer line}
{template call for conditional data}
The result was that the blank line was added even when the conditional data was not. If a report has multiple conditional sections, this can cause gaps in the output. As in my case, if those conditional sections are at the end, it can cause a blank page.
The solution is to move the spacer line into the template. That way it is only included if the conditional data is included.
Your report now looks like this:
...content...
{template call for conditional data}
And the template looks like this:
{begin template}
{blank spacer line}
...content...
{end template}
This has the added benefit of including the spacing for each instance of the data, in case there are multiple instances of the conditional data.
One last note on extra lines: Beware a space. If a line in your RTF has a field form that does not generate output (such as an if statement), it will not generate a line on the output. However, if there's a space before or after the form field it WILL generate a line.