VSView Reporting Edition Reference > Section Object > Section Properties > Height Property (Section) |
Returns or sets the Section height.
section.Height[ = value As Double ]
The Height of a section should be large enough to accommodate all Fields in the section.
The Report Designer automatically adjusts section heights when fields are added, moved, or resized. The code below shows how an application can ensure that the section is tall enough to accommodate all the fields it contains:
' get section object
Dim theSection As VSREPORTLibCtl.Section
Set theSection = vsr.Sections(vsrDetail)
' scan all its fields
For i = 0 To theSection.Fields.Count - 1
' get field bottom
Dim theField As VSREPORTLibCtl.Field
Set theField = theSection.Fields(i)
h = theField.Top + theField.Height
' make sure section is tall enough for the field
If h > theSection.Height Then
theSection.Height = h + 200
End If
Next
Double