Top 3 Shaded

colmtourque

Registered User.
Local time
Today, 14:17
Joined
Sep 26, 2002
Messages
83
I have a report that shows ids, names and 6 rows of numbers.
as such

Record 1: ID LName FName Total1 Total2 Total3 Total4 Total5 Total 6
Record 2: ID LName FName Total1 Total2 Total3 Total4 Total5 Total 6
Record 3: ID LName FName Total1 Total2 Total3 Total4 Total5 Total 6
Record 4: ID LName FName Total1 Total2 Total3 Total4 Total5 Total 6
So on....

I would like to Shade the top 3 Totals in each column.

I found this

Is there a way I could use "Select Top 3" for instance to do this.
Curous if this would be the beast way or if I should just have the numbers and 6 sub reports to show the top 3 in each of the 6 catagories
 
try this, it'll turn the backgorund light grey

Option Compare Database

Private RecCount As Integer

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

RecCount = RecCount + 1

If RecCount <= 3 Then
Me.Detail.BackColor = 12632256
Else
Me.Detail.BackColor = 16777215
End If

End Sub


hope it works for you

L
 
I must have mistated

Not the top 3, but the top 3 Numbers in each column, as in lets say one column is
10
20
30
8
50
7

I would want 50, 30, and 20 shaded and only for that column, not the rest of the row.
Make more sense.
 
ah, thats a bit different! Never done it and I think you will need to assess the top three in a seperate routine as anything done in the detail section deals with the current record only. Sorry I can't be of more use!

L
 
C,

Interesting exercise...

It would be possible, but I think you'd have to do it in code.

I think the entire report is formatted prior to any of
the Print events begin available.

Format Page Header event: Initialize Top 3 to 0

Detail Format event: Compare each line to Top 3

Store these for each page.

Then in the Detail Print event; if = Top 3 values for that
page, highlight it.

Wayne
 

Users who are viewing this thread

Back
Top Bottom