Jasper Report - Only the heading of the print group when at least one part is on the page.

I am creating a jasper report with some very specific requirements.

  • The report contains a group.
  • The group title should print at the beginning of the group, as well as on a new page.

This is not a problem, as I just have to say it "Reprint the title on every page." So far so good.

  1. The information section is not allowed to be paginated.
  2. The group heading should not be printed at the bottom of the page unless at least one section of the details is suitable. (May be rephrased as: The group heading should only be printed when at least one section of the part matches)

At this point, I noticed that the group is called "Min Height To Start New Page". This would be useful for details of a section of constant height, however ...

  1. Detailed section - dynamic height.

I tried using "Keep together" in a group, but this may leave too much free space on the pages if the first group is small and the second is large. He was rejected as a decision.

Given these requirements. All I am trying to do is not to print the group title when the page cannot fit into any details.

I suspect that when he fills out the report, he probably does not know the height of the details section until he fills it out, and by then it is too late. I hope I'm wrong.

I tried to recreate this report in two ways:

  • One report with separation of groups and details.
  • The main report with a subheading for the group, and within the subreport, another report for a detailed description.

Both methods led me to the same results.

Visually, if it was my data:

Province - Ontario City - Ottawa City - Toronto Province - Nova Scotia City - Halifax City - New Glasgow Province - Quebec City - Montreal City - Quebec City 

I can get this result:

 **Page 1** Province - Ontario City - Ottawa City - Toronto Province - Nova Scotia City - Halifax City - New Glasgow Province - Quebec **<- This hanging header is unwanted** **Page 2** Province - Quebec City - Montreal City - Quebec City 

I tried a lot of permutations of the settings, putting the subheadings in different groups, but I did not find something that works. I hope someone knows about a combination of settings, placing subscriptions in different groups, etc., that will work.

Any idea how I can do this?

+6
source share
2 answers

You cannot really prevent this, because your group of details may be more than one page. However, you have a few options that you can try.

  • Go to the group’s properties and set the "minimum height for starting a new page" to about 200 or a value that suits your needs.

  • Secondly, you can check the "print group title on each page", so that if the information section moves across the page, the title is repeated.

Hope this helps!

0
source

To answer question 4, without a group heading at the end of the page without any details, this solution may work. You say in No. 5 that the part section is dynamic in height. If you mean the height of the strip of parts, then I do not have a good solution. If you are referring to the number of detailed entries in the details section for a group, then the following solution should work.

Similar to what Fatih claimed, set the "minimum height for new page" parameter to the number of pixels in the height of the title bar of the group, as well as the number of pixels in the height of the detail range. This will force the group title to print only on the next page if there is no space for the group title and one detailed range.

Hope this helps.

0
source

Source: https://habr.com/ru/post/979405/


All Articles