Underline, overline, and double-underline for financial columns - Reports - A2000

L

L Mehl

Hello --

Some of the reports in my application present columns of financial
information which contain values, subtotals of those values, and totals of
subtotals.

Column widths in a given report vary, and it takes a while to set up each
column. I want to find a technique to simplify making headings, numbers,
underlines overlines, and double-underlines be the same width, align and
look good, as in the crude representation below (all of the headings,
values, and lines in the second column are right-justified):

coltitle <--textbox containing coltitle
-------- <--underline
group1 name
rowname1-1 value1-1 <--textbox containing col value
rowname1-2 value1-2
....
-------- <--overline
group1name subtotal1
-------- <--underline

group2 name
rowname2-1 value1-1
rowname2-2 value1-2
....
-------- <--overline
group2name subtotal2
-------- <--underline
biggroup1 Grand total
======== <--double underline

Does anyone know of a technique for Reports to make the widths of such lines
be the same as the width of the related textboxes containing names or
numbers, and to adjust automatically if I change the width of a related
textbox?

Thanks for any ideas.

Larry Mehl
 
M

Marshall Barton

L said:
Hello --

Some of the reports in my application present columns of financial
information which contain values, subtotals of those values, and totals of
subtotals.

Column widths in a given report vary, and it takes a while to set up each
column. I want to find a technique to simplify making headings, numbers,
underlines overlines, and double-underlines be the same width, align and
look good, as in the crude representation below (all of the headings,
values, and lines in the second column are right-justified):

coltitle <--textbox containing coltitle
-------- <--underline
group1 name
rowname1-1 value1-1 <--textbox containing col value
rowname1-2 value1-2
...
-------- <--overline
group1name subtotal1
-------- <--underline

group2 name
rowname2-1 value1-1
rowname2-2 value1-2
...
-------- <--overline
group2name subtotal2
-------- <--underline
biggroup1 Grand total
======== <--double underline

Does anyone know of a technique for Reports to make the widths of such lines
be the same as the width of the related textboxes containing names or
numbers, and to adjust automatically if I change the width of a related
textbox?


You can draw any kind of line you want using the report's
Line method. For example, you can code something like this
to drar the over and under lines in the group footer's Print
event:

Me.Line (GT.Left, GT.Top) - Step(Gt.Width, Gt.Height)
Me.Line (GT.Left, GT.Top + Gt.Height) - Step(Gt.Width, 0)

where GT is the name of the grand total text box.

There many related report properties that can be set to
control various properties of the line (e.g. DrawWidth,
DrawStyle, Scale...)
 
D

Duane Hookom

Larry,
There may be a better method.
Create a function in a standard module:

Function MakeLines(rpt As Report)
Dim ctl As Control
Dim dblSpacing As Double 'space between double underline
dblSpacing = 30
For Each ctl In rpt.Controls
If ctl.Tag = "bl" Then
rpt.Line (ctl.Left, ctl.Top + ctl.Height)-Step(ctl.Width, 0)
End If
If ctl.Tag = "tl" Then
rpt.Line (ctl.Left, ctl.Top)-Step(ctl.Width, 0)
End If
If ctl.Tag = "dbl" Then
rpt.Line (ctl.Left, ctl.Top + ctl.Height)-Step(ctl.Width, 0)
rpt.Line (ctl.Left, ctl.Top + ctl.Height +
dblSpacing)-Step(ctl.Width, 0)
End If
Next
End Function

Edit the tag property of the controls you want to mark. Use bl for bottom
line, tl for top line, and dbl for double bottom line. Then add this code to
the section containing the controls.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Call MakeLines(Me)
End Sub
 
Top