shading lines of data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to code a report so that individual lines of data alternate
from shaded to transparent?

I have reports that generate long lists and it's difficult to read them. I
thought alternate shading would help with this.

In my design I have a report header with a single "line" of data in the
detail. That is to say that there are several text boxes all on the same
vertical line.

Thanks!
 
I can't think on a differen way, but on the format event of the detail
section you can enter the code

Me.Field1.BackColor = IIf(Me.Field1.BackColor = 16777215, 12632256, 16777215)
Me.Field2.BackColor = IIf(Me.Field2.BackColor = 16777215, 12632256, 16777215)
Me.Field3.BackColor = IIf(Me.Field3.BackColor = 16777215, 12632256, 16777215)
 
JohnLute said:
Is it possible to code a report so that individual lines of data alternate
from shaded to transparent?

I have reports that generate long lists and it's difficult to read them. I
thought alternate shading would help with this.

In my design I have a report header with a single "line" of data in the
detail. That is to say that there are several text boxes all on the same
vertical line.


It's easy enough to shade alternating horizontal lines.
But, vertical lines are a different situation. could you
provide more details about the layout of the report and how
you want it to look? At this point all I can suggest is
using the Page event to draw shaded rectangles at specific
locations on the paper.
 
Perfect! Thanks a bunch!
--
www.Marzetti.com


Ofer said:
I can't think on a differen way, but on the format event of the detail
section you can enter the code

Me.Field1.BackColor = IIf(Me.Field1.BackColor = 16777215, 12632256, 16777215)
Me.Field2.BackColor = IIf(Me.Field2.BackColor = 16777215, 12632256, 16777215)
Me.Field3.BackColor = IIf(Me.Field3.BackColor = 16777215, 12632256, 16777215)
--
If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck
 
Hi, Marshall. Actually, my brain was thinking "horizontal" but my fingers
typed "vertical."

I used Ofer's suggestion and it worked, however, I'd like to learn more.
What suggestion(s) do you have? As I noted, I have several text boxes that
run side-by-side along the same HORIZONTAL line.

How would you manage this?

THANKS!
 
As I previously posted: this works fine despite the fact that I meant to say
"horizontal" rather than "vertical."

What about when one of the text boxes has a null value? This results in the
report looking choppy. For example one line may have 3 boxes shaded from left
to right and the next shaded line may have 5 boxes shaded from left to right.
I'm wondering if I can shade null values so that each shaded line is shaded
all the way across.

Hope that makes sense.

Thanks!!!
 
I'm not Marshall, but this is one way to do this. It also answers your
other question about shading the entire line

Make sure the BackStyle of each control is Transparent.

Code the Detail Format event:

If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 12632256 'gray
Else
Me.Section(0).BackColor = vbWhite
End If
 
Bang! Very nice! Thank you, John!

This has been a very interesting thread for me. I've learned a couple ways
to achieve this for both horizontal and vertical needs.

Thanks everybody!
 
JohnLute said:
Hi, Marshall. Actually, my brain was thinking "horizontal" but my fingers
typed "vertical."

I used Ofer's suggestion and it worked, however, I'd like to learn more.
What suggestion(s) do you have? As I noted, I have several text boxes that
run side-by-side along the same HORIZONTAL line.

How would you manage this?


Just in case you were wondering if there are other ways, I
would do it the same way as John.
 
Back
Top