|
|
Создание в отчетах таблиц с изменяемой высотой строк.
Public Sub DrawTableInDetailSection(objReportSection As Section, Optional lColor&)
Dim DataControl As Control
Dim x As Integer
Dim MaxHeight As Integer
Dim MinX As Integer
Dim MaxX As Integer
Dim StartX As Integer
Dim EndX As Integer
Dim StartY As Integer
Dim EndY As Integer
On Error GoTo DrawTableInDetailSectionERR
MaxX = 0
MinX = 0
With objReportSection
For Each DataControl In .Controls
x = DataControl.Height
If MaxHeight < x Then MaxHeight = x
x = DataControl.Left + DataControl.Width
If MaxX < x Then MaxX = x
x = DataControl.Left
If MinX > x Then MinX = x
Next
EndY = MaxHeight
.Parent.Line (MinX, StartY)-(MinX, EndY), lColor
.Parent.Line (MinX, EndY)-(MaxX, EndY), lColor
For Each DataControl In .Controls
StartX = DataControl.Left + DataControl.Width
EndX = StartX
.Parent.Line (StartX, StartY)-(StartX, EndY), lColor
Next
End With
Exit Sub
DrawTableInDetailSectionERR:
Err.Clear
End Sub
|
|