How to make my report look like a table?

snoopy22

Registered User.
Local time
Today, 00:27
Joined
Oct 1, 2004
Messages
45
I would like to sepreate the "cells" and "rows" in my report with bold lines
so it will look like a table.

How can i do it?
 
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
 
Thanks rich!

your code really helps, but I need the whole report to look like a table,
not just the details section.
can you tell me how to change the code to influence on the whole report?

thanks in advance,ofir
 
Snoopy,

Can't you just set the border style on all of your controls to "Solid", etc.

Wayne
 
Yes...

It looks nice, but I still want to bold the external lines... any idea?

thanks for your help
 
Use REPORTS onPage funct

I needed something simillar, so I experimented with the lines from VB and those can be very handy:
I needed a line that goes accross an entire report so I set the reports OnPage function and put in:



Private Sub Report_Page()
DrawWidth = 15 '' I needed a thick line so I set it to 15
y1 = TotGrp * 330 '' for every row of report height in pixels, you can set whatever you like
Me.Line (5092, 3580 + y1)-(11110, 3580 + y1), 0
DrawWidth = 15
Me.Line (5092, 3580 + y1)-(60, 11500), 0
End Sub
 
I used Rich's code above and it works nicely, with one little cavaet:

The section header is ''wider" than the details, so there are empty spaces to right of data in detail section. Rich's code would draw an extraneous cell in that empty space.

I can't figure out how to modify his code so it subtract one cell from right, or to make the loop stop one control short. I tried to change from For Each..Next to a For...Next based on the control collection's count, but no go.

Any suggestions?
 
*bump*

Would like to fix the code so it comes up one "box" short as explained above.


Any suggestions?
 
I added few lines to count the controls before the loop, then check the counter inside the loop and exiting the loop one control short.

It ran, but didn't seem to do anything. To be honest, I'm not very sure how exactly the code works.

Would love it if somebody would give me a quick rundown on what code is supposed to do.
 

Users who are viewing this thread

Back
Top Bottom