Showing posts with label groups. Show all posts
Showing posts with label groups. Show all posts

Thursday, March 29, 2012

alternate row color in groups

Hi:
I am trying to alternate row colors within groups, and I do this
<BackgroundColor>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothin
g) Mod 2, "Cornsilk", "White")</BackgroundColor>
but the problem is my country field has duplicates, and the color is
not alternating in such cases. I tried Count instead of CountDistinct,
but it doesnt work.
Any suggestions?
ThanksI use something like Iif(RowNumber("myGroupName") Mod 2 = 0, "PowderBlue",
"White")
"NI" wrote:
> Hi:
> I am trying to alternate row colors within groups, and I do this
> <BackgroundColor>=iif(RunningValue(Fields!Country.Value,CountDistinct,Nothin
> g) Mod 2, "Cornsilk", "White")</BackgroundColor>
> but the problem is my country field has duplicates, and the color is
> not alternating in such cases. I tried Count instead of CountDistinct,
> but it doesnt work.
> Any suggestions?
> Thanks
>sql

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,
> > >
> > >

Alternate color on groups.

How would you alternate the color in a grid based on a grouping.

IE. (the 1000 Users should have background color of White and 2000 background would be WhiteSmoke)

ColumnUser ColumnNote

1000 Note1

1000 Note2

2000 Note1

2000 Note2

Try using the following expression for the BackgroundColor property.

=iif(RunningValue(Fields!ColumnUser.Value,CountDistinct,Nothing) Mod 2, "White", "WhiteSmoke")

|||nice...thanks!

Thursday, March 8, 2012

alter login on Windows user groups

Hi,
I have problem with respect to "alter login" on Windows user groups (created
via Active Directory).
If I execute the statement "alter login [domain\groupname] enable" I get
an
exception saying (the exception also occurs with "alter login
[domain\groupname] disable"):
Msg 15151, Level 16, State 1, Line 1
Cannot alter the login of 'domain\groupname', because it does not exist or
you do not have permissions.
If if try to enable the login via SQL Server Management GUI I get the same
exception.
Is this because it is not at all possible to alter the logins of windows
user groups? Or is it a bug in SQL Server?
I am running MS SQL Server 2005 SP1 (compatibility level 90).
The user I am executing the statement as is "sysadmin" on the server.
Thanks in advance.
Kind Regards,
Rune Jensen
ETIAFAIK you can only disable/enable logins that represent individual windows
accounts, not windows groups.
HTH,
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
"Server App" <aaa@.yes.dk> wrote in message
news:%23VF$pTC%23GHA.4376@.TK2MSFTNGP03.phx.gbl...
> Hi,
> I have problem with respect to "alter login" on Windows user groups
> (created
> via Active Directory).
> If I execute the statement "alter login [domain\groupname] enable" I g
et
> an
> exception saying (the exception also occurs with "alter login
> [domain\groupname] disable"):
> Msg 15151, Level 16, State 1, Line 1
> Cannot alter the login of 'domain\groupname', because it does not exist or
> you do not have permissions.
> If if try to enable the login via SQL Server Management GUI I get the same
> exception.
> Is this because it is not at all possible to alter the logins of windows
> user groups? Or is it a bug in SQL Server?
> I am running MS SQL Server 2005 SP1 (compatibility level 90).
> The user I am executing the statement as is "sysadmin" on the server.
> Thanks in advance.
> Kind Regards,
> Rune Jensen
> ETI
>
>