Framing a repoert page with a rectangle

realnine

Registered User.
Local time
Today, 15:10
Joined
Jun 10, 2003
Messages
40
I use report writer to print invoices on a page. The report writer has report header- not used; page header - not used; and source header which has all the mailing information. The detail section list all charges. The source footer sums the amount due. The page and report footer are not used. I need a rectangle to frame the report on each page. This is necessary to match the previous look of the invoices. I have tried using lines at the bottom of each section and on each side but that is a tedious process. One other thought is to print the rectangle and company logo only on paper. Use the already printed paper to print the report which will be formatted to fit in the boundries of the preprinted rectangle. In other words I would have to use paper which has already been printed with the rectangel and logo to print the report.

Thanks for considering this problem for me.
 
real,

In Design view, select the rectangle, Format --> Send to back

Wayne
 
if you want to do this in VBA use the Line Method:

The following example uses the Line method to draw a red rectangle five pixels inside the edge of a report named EmployeeReport. The RGB function is used to make the line red.
To try this example in Microsoft Access, create a new report. Paste the following code in the declarations section of the report's module, then switch to Print Preview.

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
	' Call the Drawline procedure
	DrawLine
End Sub

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

	Set rpt = Reports!EmployeeReport
	' Set scale to pixels.
	rpt.ScaleMode = 3
	' Top inside edge.
	sngTop = rpt.ScaleTop + 5
	' 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, B
End Sub
 
WayneRyan said:
real,

In Design view, select the rectangle, Format --> Send to back

Wayne

I need to Draw the rectangle to encompass the agregate detail items. When I draw the rectangle in the detail section each entry has a rectangle around it.

Thanks for your interest.
 
Fornatian said:
if you want to do this in VBA use the Line Method:

The following example uses the Line method to draw a red rectangle five pixels inside the edge of a report named EmployeeReport. The RGB function is used to make the line red.
To try this example in Microsoft Access, create a new report. Paste the following code in the declarations section of the report's module, then switch to Print Preview.

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
	' Call the Drawline procedure
	DrawLine
End Sub

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

	Set rpt = Reports!EmployeeReport
	' Set scale to pixels.
	rpt.ScaleMode = 3
	' Top inside edge.
	sngTop = rpt.ScaleTop + 5
	' 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, B
End Sub

Ian,
Thanks for your response. This approach is beyond my experience level. I don't know about modules so I don't know where to insert the code. I am going with what I have and let the clients get used to the new look.

Thanks again
 
following waynes advice, instead of drawing a box use four different lines, one at the very bottom of the group header, one at the very top of the group footer, and two the height of the detail section at each end to form the sides of the resultant rectangle. When run the two vertical elements will repeat until the end of section and join the horizontals.
 
Thanks again Ian,

That is what I am doing now, I was searching for a more effiecient way of doing it. I put a horizantal line at the bottom of the the section header, left and right lines in the detail section, and a horizontal line at the top of the section footer. THe problem I have is getting the lines of the lenght and position that there are no spaces or overruns. When the lines are placed to the extreme margins, they are difficult to highlight. Does anyone know of a way to zoom (magnify) the design view of a report writer.

So much to know, so little time
 
If selecting them is a problem, rename them aLine1 and aLine2, they will then appear at or near to the top of the dropdown in the corner of the screen which is an alternative to selecting by mouse.
 
As far as I remember, the "solutions9" database dowloadable from micro$oft has a module for adding a rectangle around reports
 
Happy,

re: the "solutions9" database dowloadable from micro$oft has a module for adding a rectangle around reports

I searched the MS site for your reference and could not find it. Can you recall anymore detail on where to find the "solution9".

Thanks
 
Private Sub Report_Page()

'Draw a page border around this report.
Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), , B

End Sub
 
I need to Draw the rectangle to encompass the agregate detail items. When I draw the rectangle in the detail section each entry has a rectangle around it.

The Line method will not work for this.
 

Users who are viewing this thread

Back
Top Bottom