---
name: layout-pagination
description: Fix JasperReports band layout and pagination, including clipped or overlapping text, stretch and float behavior, band split rules, unexpected or missing page breaks, repeated page, column and group headers, page X of Y numbering, empty-input pages and multi-column reports. Use when output is cut off, overlaps, breaks pages in the wrong place or has the wrong page count; not for query parameters, totals or export-only formatting.
---
# Fix layout and pagination
## Establish the layout contract
Identify the exact engine/Java versions, the output formats that must paginate, the page size, orientation and margins, each band's height, the longest realistic values for every text field and the rules for records that must stay together, repeated headers and empty input. Ask for missing rules instead of guessing which content may be cut, shrunk or moved.
## Workflow
1. Check page geometry first. For one column, `columnWidth` must fit `pageWidth` minus the left and right margins; with `columnCount`, all columns plus `columnSpacing` must fit. Compute the detail height available on a page: `pageHeight` minus the margins and the title, page header, column header, column footer and page footer bands that print on that page. Use it to choose exact page-boundary fixtures, such as rows that fill a page exactly and one row more.
2. Let variable text grow. A text field with a fixed height silently truncates its text: the tested 7.1.1 runtime raises no error and stores only the visible part in the filled report. Use `textAdjust="StretchHeight"` for text that must be shown in full. Use `ScaleFont` only when the requirements allow smaller text, and keep the fixed height only when truncation is intended.
3. Move what sits below growing content. Give elements below a stretching element `positionType="Float"`, otherwise they keep their design position and overlap the grown text. Use `FixRelativeToBottom` for content that must stay at the bottom of a stretched band, and `stretchType="ContainerHeight"` for borders, lines and backgrounds that must follow the band height.
4. Decide how bands split. The band attribute `splitType="Stretch"` lets a stretched band continue on the next page. `Prevent` moves the whole band to the next page when it does not fit in the remaining space, but still splits a band that is taller than a full page. `Immediate` splits at any point. For groups, use `keepTogether` or `minHeightToStartNewPage` instead of fixed spacer bands.
5. Repeat headers deliberately. Page and column headers print on every page; use `reprintHeaderOnEachPage="true"` on a group for a group header that must repeat after a page break. Build "Page X of Y" from two fields: the current page evaluated `Now` and the total page count evaluated at `Report`.
6. Define empty input with `whenNoDataType`. In the tested runtime, the default `NoPages` produces a report with zero pages, `BlankPage` produces one empty page, and `AllSectionsNoDetail` prints the non-detail sections. Use `NoDataSection` with a `noData` band when callers need an explicit message, and make sure callers handle a zero-page report.
7. Choose the multi-column fill order. With `columnCount` above 1, `printOrder="Vertical"` fills one column down the page before the next, and `Horizontal` fills across columns row by row. Fit every element within `columnWidth`.
8. Do not set `ignorePagination` to hide a paginated-output problem. It changes every exporter's output and suits only single-sheet or HTML-style output that was designed for it.
## Validate and deliver
Fill with short and long values, an empty input, a page that is exactly full and one record more, and any record that must stay together. Assert page counts, repeated header text, full printed text values and element positions or heights from the filled `JasperPrint`, then export the paginated formats. Inspect a rendered page for visual clipping, overlap and font fallback, which element data alone cannot prove. State commands and results, and label any layout you could not render or fill as unverified.
## Sources
- [Sample reference](https://jasperreports.sourceforge.net/sample.reference/README.html)
- [Schema reference](https://jasperreports.sourceforge.net/schema.reference.html)
- [API](https://jasperreports.sourceforge.net/api/index.html)
— ‹guest · 2026-11-29› —
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.