Report format and border style

Gismo

Registered User.
Local time
Today, 06:21
Joined
Jun 12, 2017
Messages
1,298
Hi all,

I have a main report with multiple sub reports

On the main form I would like to insert a border at a specific Width, height and top and must be visible on all the sub reports at the same position and formating

Please could you guide me in the right direction

I tried to manually draw a rectangular frame with shading and placing it on the man form behind all the sub reports but then the header and footer does not have a border, I decided that doing this via VBA would probably give the best result

1645167114354.png
 
where on the report would you put it?
you can add a border to your report.
using On Page Event:

Private Sub Report_Page()
Me.Line (0, 0)-(.ScaleWidth - 5, .ScaleHeight - 5), vbBlack, B
End Sub
 
where on the report would you put it?
you can add a border to your report.
using On Page Event:

Private Sub Report_Page()
Me.Line (0, 0)-(.ScaleWidth - 5, .ScaleHeight - 5), vbBlack, B
End Sub
I actually used the exact same code
Had an error on .ScaleWidth as an invalid or inqualified reference

I want to be able to set the below formats

1645168953635.png
 
use Me.ScaleWidth, Me.ScaleHeight
 
Private Sub Report_Page()
Me.Line (0, 0)-(Me.ScaleWidth - 5, Me.ScaleHeight - 5), 10921638, B
End Sub

Snap10.png
 
try it first and see. the line is already in the page "boundary".
there is no "move to back" option.
 
try it first and see. the line is already in the page "boundary".
there is no "move to back" option.
I found the below

Seems to work ok

Still the frame is on top of Text, even if i bring text to the front

Private Sub Report_Page()
Dim rpt As Report, lngColor As Long
Dim sngTop As Single, sngLeft As Single
Dim sngWidth As Single, sngHeight As Single

Set rpt = Reports!ScheduledMaintenanceHead_Manual
' Set scale to pixels.
rpt.ScaleMode = 3
' Top inside edge.
sngTop = rpt.ScaleTop + 230
' Left inside edge.
sngLeft = rpt.ScaleLeft + 5
' Width inside edge.
sngWidth = rpt.ScaleWidth - 10
' Height inside edge.
sngHeight = rpt.ScaleHeight - 10
' Make color red.
lngColor = RGB(255, 0, 0)
' Draw line as a box.
rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, BF
End Sub
 
Last edited:
which Text? on the Top?
you adjust this:

sngTop = rpt.ScaleTop + 230 '<-- add more so your rectangle will move downward.
 
which Text? on the Top?
you adjust this:

sngTop = rpt.ScaleTop + 230 '<-- add more so your rectangle will move downward.
I have sub reports in the detail as well as text in the header and footer
I can not see any of those, the border, which is filled, is on top of the sub reports, no data can be seen

The border which is filled in grey, needs to be under laying the text / Subreports
 
the "border" is but a Line it is not a Rectangle.
maybe you have Rectangle in your report.
Snap11.png
 
oopss, you need to specify B only (not BF) on the Line method:

rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B

with "F", it means fill-the area with lngColor.
 
oopss, you need to specify B only (not BF) on the Line method:

rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B

with "F", it means fill-the area with lngColor.
Yes, that was my intention to have the frame filled in with grey
I now made each subreport a grey background and kept the frame as transparent
 
oopss, you need to specify B only (not BF) on the Line method:

rpt.Line (sngTop, sngLeft)-(sngWidth, sngHeight), lngColor, B

with "F", it means fill-the area with lngColor.
Thank you for your assistance
 
I have the related issue with border. I shall be grateful if anybody helps me how can I change the border width of the lines, I mean, the lines are too thin. Can they be made thiacker? and how? please.
 
use the drawwidth property before specifying the line - this draws a thick box around the border. Alternative to the above.

Me.DrawWidth = 60
Me.Line (0, 0)-(Me.ScaleWidth - 5, 0) 'top
Me.Line (0, 0)-(0, Me.ScaleHeight - 5) 'left
Me.Line (0, Me.ScaleHeight - 5)-(Me.ScaleWidth - 5, Me.ScaleHeight - 5) 'bottom
Me.Line (Me.ScaleWidth - 5, 0)-(Me.ScaleWidth - 5, Me.ScaleHeight - 5) 'right
 
@mshakeelattari You've been a member for a very long time but never posted.

Please, in the future, do NOT hijack existing threads for new questions. If you think an old thread is relevant, just post a link to it in a NEW thread. You're lucky CJ bothered to answer such an old thread.
 

Users who are viewing this thread

Back
Top Bottom