Alternate colors in report for multicolumn report

M

millie.patel

Hi All,

I have a report that has a subreport with 4 columns (Level 1, 2, 3, 4).

I want the report to alternate colors every row; however, each row may
have different size values in the columns --
for example:


Level 1 Level 2 Level 3 Level 4
x x x xxx
xxx xx xxx


that is one row -- i need it to shade the entire row grey -- and the
height of the shading to be as long as the Level 4 text.


Any ideas/suggestions?


Thanks,


Millie
 
M

millie.patel

When I do that, it highlights just the text in the row -- so if text is
longer in one column, it is highlighted more --

The entire row is not highlighted -- only the text
 
S

SusanV

Huh? This should set the background color of the row - not any text
formatting such as foreground color or bold or any of that. I use it to
alternate grey and white is several reports as follows:

'===========
Private m_RowCount As Long
'===========
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
m_RowCount = m_RowCount + 1
If m_RowCount / 2 = CLng(m_RowCount / 2) Then
Me.Detail.BackColor = 12632256 'Set to grey
Else
Me.Detail.BackColor = 16777215 'This is the white row
End If
End Sub
'===========


Can you post the entire Detail_Format sub?

SusanV
 
M

millie.patel

Option Compare Database
Private shadeNextRow As Boolean
Private lastProgression As String
Private lastProgressionRow As String
Const shadedColor = 16770273
Const normalColor = 16777215
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If lastProgression <> Me!Progression Or lastProgressionRow <>
Me!ProgressionRow Then
shadeNextRow = Not shadeNextRow
lastProgression = Me!Progression
lastProgressionRow = Me!ProgressionRow
End If
If shadeNextRow Then
Me.Section(acDetail).BackColor = shadedColor
Else
Me.Section(acDetail).BackColor = normalColor
End If
If Me!CapabilityColor = "red" Then
Me!Capability.ForeColor = RGB(255, 0, 0)
ElseIf Me!CapabilityColor = "orange" Then
Me! Capability.ForeColor = RGB(255, 140, 0)
ElseIf Me!CapabilityColor = "green" Then
Me! Capability.ForeColor = RGB(0, 100, 0)
ElseIf Me!CapabilityColor = "purple" Then
Me!Capability.ForeColor = RGB(148, 0, 211)
ElseIf Me! CapabilityColor = "blue" Then
Me!Capability.ForeColor = RGB(0, 0, 255)
End If
End Sub
 
M

millie.patel

using the code you provided and using this code that i just pasted, i
get the same results
 
R

Rick Brandt

yup

i still get the data being highlighted - not the entire row

When you state that you have "multiple columns of data" do you mean multiple
fields arranged in columns or do you mean that you are using the
Multi-column options in Page Setup of the report?

Using the "newspaper columns" option in page setup will produce a different
effect because the detail section is not only repeated in horizontal bands
but also snaked into columns and the background WILL have some margin
separation between those columns.
 
M

millie.patel

The subreport is broken up into 4 columns via the Page Setup of the
report....

So is there any way of getting around this issue?
 
M

millie.patel

The subreport is broken up into 4 columns via the Page Setup of the
report....

So is there any way of getting around this issue?
 
M

millie.patel

The subreport is broken up into 4 columns via the Page Setup of the
report....

So is there any way of getting around this issue?
 
S

SusanV

Hi millie,
I honestly don't know... Sorry =(

SusanV
The subreport is broken up into 4 columns via the Page Setup of the
report....

So is there any way of getting around this issue?
 
R

Rick Brandt

The subreport is broken up into 4 columns via the Page Setup of the
report....

So is there any way of getting around this issue?

You can set the spacing between the columns to zero and make the physical
column a bit wider to provide the same spacing, but the first row at the top
of each column will not be the same actual "row" that is at the top of any
of the other columns.

In order to to get the same odd/even color you will have to configure your
page setup so that each column ends on an even numbered row so that the
first row at the top of the next column will always be an odd numbered row.
If you have no controls in the report that Grow or Shrink then this should
be possible to do. If you do have anything that grows/shrinks then you're
SOL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top