FlexReport for WinForms | ComponentOne
C1.Win.FlexReport.4.5.2 Assembly / C1.Win.FlexReport Namespace / C1FlexReport Class / AvailableHeight Property

In This Topic
    AvailableHeight Property (C1FlexReport)
    In This Topic
    Gets the height of the remaining area available for sections on the current page. This property can only be used while the report is being rendered in paginated mode (i.e. when C1.Win.C1Document.C1DocumentSource.IsBusy and C1.Win.C1Document.C1DocumentSource.Paginated are true). If C1.Win.C1Document.C1DocumentSource.IsBusy is false then -1 is returned. If C1.Win.C1Document.C1DocumentSource.Paginated is false then double.MaxValue is returned. Note that if used in OnPrint/OnFormat scripts, this value does NOT account for the current section's height. For subreports this property returns AvailableHeight of the master report.
    Syntax
    'Declaration
     
    Public ReadOnly Property AvailableHeight As Double
    public double AvailableHeight {get;}
    Remarks
    Here is an example of code which can be used in the detail section's OnFormat script to determine whether the current detail section will be the last one printed on the page (the test checks that the current section will fit onto the page while the next section won't): h = Detail.RenderHeight ah = Report.AvailableHeight if (h < ah) and (2 * h > ah) then Detail.BackColor = RGB(255, 0, 0) ' last on page else Detail.BackColor = RGB(255, 255, 255) endif
    See Also