Wrapping Overflowing Rotated Table on the Same Page
Environment
Product | Progress Telerik Reporting |
---|
Description
I want to wrap a rotated table in Telerik Reporting if it doesn't fit inside the page horizontally. Additionally, I want the column headers to be visible in the wrapped content.
Solution
To achieve this, you can use Report Groups in Telerik Reporting. Each group will render an instance of the rotated table with data for as many items as can fit on one page. To show the headers on each new row or table, you can use the RowHeadersPrintOnEveryPage property of the table.
Follow these steps to wrap the overflowing table on the same page in Telerik Reporting:
- Add an Integer Report Parameter to the report to define the count of items in each row. Let's name it
ItemsOnPage
. - Assign a DataSource to the Report. It should contain a zero-based indexing field. Let's name it
Index
. - Add a Report Group with Grouping
= Fields.Index / Parameters.ItemsOnPage.Value
. This allows you to easily split the data into sets with a proper count determined by the integer Parameter value. - Place the Table in the Group Header or Footer section and Bind the Table DataSource to the parent DataSource, which contains only the data for the corresponding Report Group.
- Set the Table's
RowHeadersPrintOnEveryPage
toTrue
so that the headers are displayed on each row. - Run the report in
PrintPreview
mode and select a Report Parameter value that prevents the table from spilling onto the next page when you test.
That's it! Your table will now wrap and display the column headers on each new row.
Sample Report
Download the demo report WrappingRotatedTable.trdx from our Reporting Samples GitHub repository.
Notes
Make sure to adjust the ItemsOnPage
Parameter value based on the number of items that can fit on one page.