View Full Version : Spreadsheet Style Report


braithwd
01-28-2003, 08:11 PM
Can anyone please help me with a formatting question??

I have a report that has to be spreadsheet style i.e with horizontal and vertical gridlines around each "cell". In my header and detail section, I have drawn vertical lines between columns, and horizontal lines between rows.

This works, until I put a subreport in one of the columns - to select out a set of rows corresponding to one row in the main report. The number of rows returned by the subreport to be displayed in the main report is variable.

When running the report, the subreport size on the main report resizes (Can Grow=Yes), to accomodate the variable number of rows. Access moves the horizontal line between rows downwards to accomodate the variable length subreport, but the vertical lines are not stretched downwards, and are left the original size.

There is no "Can Grow" property for the vertical line, and I have tried grouping the horizontal and vertical lines, which doesn't work either.

Any ideas??

Rich
01-29-2003, 12:04 AM
Remove all the lines, add the following code
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer
intLineMargin = 60
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
Me.Line ((.left + .Width + intLineMargin), 0)-(.left + .Width + _
intLineMargin, Me.Height)
End With
Next
With Me
Me.Line (0, 0)-Step(.Width, .Height), 0, B
End With
Set CtlDetail = Nothing
End Sub