is there an easy way to draw a array in a report ?

  • Thread starter Thread starter News Microsoft
  • Start date Start date
N

News Microsoft

there's to much handling to make to draw an array in an acccess report.
i draw it line by line using lines and rectangles.

is there another way to do it ?

thanks
 
Normally, the approach I use is to simply ask where did the data in the
array come from?

Usually, the data in the array came from a table.

So, the solution is to send that data to the report. Even if you just send a
list of id's to the report writer, then it is a easy matter to use some
functions to lookup values in a array or collection and display those values
on the report.

Another possible approach which is easer then above is to simply write out
the values to a temp table, and then run the report on that temp table.

Temp tables should be avoided in ms-access, but it often is a easy solution
to the this type of problem..
 
Are you referring to a grid rather than an array? You don't mention anything
about text values but do mention lines and rectangles. You could use the
Line method of the report to draw lines or rectangles. The following code
will draw 18 horizontal lines across your page with a spacing equal to the
height of the detail section. You could easily modify this code to draw
horizontal and/or vertical lines with whatever spacing you want. To fill a
page, place this code in the On Page event of the report.

Private Sub Report_Page()
Dim intLineCount As Integer
Dim intLines As Integer
Dim intLineSpacing As Integer
Dim intTopMargin As Integer
Dim intYPos As Integer

intLines = 18
intTopMargin = 720 'half inch
intLineSpacing = Me.Detail.Height
For intLineCount = 1 To intLines
intYPos = (intLineCount * intLineSpacing) + _
intTopMargin
Me.Line (0, intYPos)- _
Step(Me.Width, 0)
Next
End Sub
 
Back
Top