Tuesday, March 27, 2012

Alternate coloring in Groups

Hi,
im able to get the alternate coloring in tables using the code
=iif(RowNumber(Nothing) Mod 2,"WhiteSmoke", "LightGrey")
when i insert a group in the table for the weekenddate.the alternate
coloring of rows has disappeared...
i cant get where im going wrong...
im grouping the record based on the weekend date...
Thanks in advamce for ur help,Using RowNumber can be a bit hit and miss.
I use a bit of code to handle this, it also works at any group level.
In report properties|Code type the following;
Public Dim Lv(4) As Boolean
Public Function Switch(ByRef Value As Boolean) As Boolean
Value = Not Value
Return Value
End Function
In the BackgroundColor property of the first cell on a row use the
following expression;
=IIf(Code.Switch(Code.Lv(1)),"WhiteSmoke","LightGrey")
In all subsequent cells use;
=IIf(Code.Lv(1),"WhiteSmoke","LightGrey")
Use different subscripts with Lv for different group levels.
This also works in matrix regions too.
Chris
CCP wrote:
> Hi,
> im able to get the alternate coloring in tables using the code
> =iif(RowNumber(Nothing) Mod 2,"WhiteSmoke", "LightGrey")
> when i insert a group in the table for the weekenddate.the alternate
> coloring of rows has disappeared...
> i cant get where im going wrong...
> im grouping the record based on the weekend date...
> Thanks in advamce for ur help,|||Thank u very much Chris ,
It worked...
"Chris McGuigan" wrote:
> Using RowNumber can be a bit hit and miss.
> I use a bit of code to handle this, it also works at any group level.
> In report properties|Code type the following;
> Public Dim Lv(4) As Boolean
> Public Function Switch(ByRef Value As Boolean) As Boolean
> Value = Not Value
> Return Value
> End Function
> In the BackgroundColor property of the first cell on a row use the
> following expression;
> =IIf(Code.Switch(Code.Lv(1)),"WhiteSmoke","LightGrey")
> In all subsequent cells use;
> =IIf(Code.Lv(1),"WhiteSmoke","LightGrey")
> Use different subscripts with Lv for different group levels.
> This also works in matrix regions too.
> Chris
>
> CCP wrote:
> > Hi,
> > im able to get the alternate coloring in tables using the code
> > =iif(RowNumber(Nothing) Mod 2,"WhiteSmoke", "LightGrey")
> > when i insert a group in the table for the weekenddate.the alternate
> > coloring of rows has disappeared...
> > i cant get where im going wrong...
> > im grouping the record based on the weekend date...
> >
> > Thanks in advamce for ur help,
>|||Chris,
Can i sort the records within the groups'
Thanks,
"CCP" wrote:
> Thank u very much Chris ,
> It worked...
>
> "Chris McGuigan" wrote:
> > Using RowNumber can be a bit hit and miss.
> >
> > I use a bit of code to handle this, it also works at any group level.
> >
> > In report properties|Code type the following;
> >
> > Public Dim Lv(4) As Boolean
> >
> > Public Function Switch(ByRef Value As Boolean) As Boolean
> > Value = Not Value
> > Return Value
> > End Function
> >
> > In the BackgroundColor property of the first cell on a row use the
> > following expression;
> >
> > =IIf(Code.Switch(Code.Lv(1)),"WhiteSmoke","LightGrey")
> >
> > In all subsequent cells use;
> >
> > =IIf(Code.Lv(1),"WhiteSmoke","LightGrey")
> >
> > Use different subscripts with Lv for different group levels.
> > This also works in matrix regions too.
> >
> > Chris
> >
> >
> >
> > CCP wrote:
> >
> > > Hi,
> > > im able to get the alternate coloring in tables using the code
> > > =iif(RowNumber(Nothing) Mod 2,"WhiteSmoke", "LightGrey")
> > > when i insert a group in the table for the weekenddate.the alternate
> > > coloring of rows has disappeared...
> > > i cant get where im going wrong...
> > > im grouping the record based on the weekend date...
> > >
> > > Thanks in advamce for ur help,
> >
> >|||Sure, right click the row tag of the relevant group, click edit group
and you will see a sorting tab.
Chris
CCP wrote:
> Chris,
> Can i sort the records within the groups'
> Thanks,
> "CCP" wrote:
> > Thank u very much Chris ,
> > It worked...
> >
> >
> > "Chris McGuigan" wrote:
> >
> > > Using RowNumber can be a bit hit and miss.
> > >
> > > I use a bit of code to handle this, it also works at any group
> > > level.
> > >
> > > In report properties|Code type the following;
> > >
> > > Public Dim Lv(4) As Boolean
> > >
> > > Public Function Switch(ByRef Value As Boolean) As Boolean
> > > Value = Not Value
> > > Return Value
> > > End Function
> > >
> > > In the BackgroundColor property of the first cell on a row use the
> > > following expression;
> > >
> > > =IIf(Code.Switch(Code.Lv(1)),"WhiteSmoke","LightGrey")
> > >
> > > In all subsequent cells use;
> > >
> > > =IIf(Code.Lv(1),"WhiteSmoke","LightGrey")
> > >
> > > Use different subscripts with Lv for different group levels.
> > > This also works in matrix regions too.
> > >
> > > Chris
> > >
> > >
> > >
> > > CCP wrote:
> > >
> > > > Hi,
> > > > im able to get the alternate coloring in tables using the code
> > > > =iif(RowNumber(Nothing) Mod 2,"WhiteSmoke", "LightGrey")
> > > > when i insert a group in the table for the weekenddate.the
> > > > alternate coloring of rows has disappeared...
> > > > i cant get where im going wrong...
> > > > im grouping the record based on the weekend date...
> > > >
> > > > Thanks in advamce for ur help,
> > >
> > >

No comments:

Post a Comment