Search code examples
wpfdevexpressxtrareport

Xtrareport DevExpress Keep Table together with the first record


I have some data that I want to be displayed the following way and I cannot find how to do it:

For example this would be the keep together case: enter image description here

But I don't like that I have a lot of blank spaces when data is too much, so I would like the following to happen if possible. When the colNames and the first row can fit in the remaining space put them there.

enter image description here

Or if more can fit after the first row, put all of them there and split where it is possible if necessary.

enter image description here

Basically I want a 'Keep together' option for the columns and first row, and everything else can be splitted at any point.


Solution

  • If anyone wants to achieve the same functionality do the following:

    1. Put the table column names inside a GroupHeader and set its GroupUnion property to WithFirstDetail.
    2. Put the table rows in the Detail next to the GroupHeader.

    By doing this the WithFirstDetail property, as the name suggests, will try to keep the header with the first record, or move to the next page. Therefore achieving the behavior described above.