FlexReport for WinForms | ComponentOne
Sections of FlexReport / Splitting FlexReport Objects
In This Topic
    Splitting FlexReport Objects
    In This Topic

    Since creating reports is all about representing data, it is important to determine the sub-section behavior when its too large to fit within the vertical space available on the current page.

    In FlexReports, any Section or Sub-section can be forced to split or not to split (keep together) between the pages by setting SplitBehavior property to SplitIfNeeded or KeepTogether.

    The KeepTogether option lets the object to be split only if it is too large to fit on an empty page. If that's the case, then the object is split immediately. Otherwise, a new page is started and the object is placed on it without splitting. While, the SplitIfNeeded option lets the object to be split if it does not fit onto the current page.

    Similarly, the splitting of Fields and Borders is governed by SplitHorzBehavior and SplitVertBehavior properties. The SplitHorzBehavior property determines how the borders are drawn for an object if it is too wide and split between pages. On the other hand, the SplitVertBehavior property determines how the borders are drawn for an object if it is too high and split between pages.

    The following code sets the SplitBehavior for a Section and a Sub-section:

    C#
    Copy Code
    // Allow section to split if needed
    c1FlexReport1.Sections.Header.SplitBehavior = SplitBehavior.SplitIfNeeded;
    // Allow sub-section to split if needed
    c1FlexReport1.Sections.Header.SubSections[0].SplitBehavior = SplitBehavior.SplitIfNeeded;