Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 How does Previous work

Author  Topic 

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-11 : 14:24:52
How does Previous(object Expression, string scope) work?

What is the object expression?

If i want to get the background color of a cell from its previous row
what do I use for the object Expression? The name of the cell ie Textbox5? The name of the property ie BackgroundColor)

BackgroundColor = Previous(object, scope)

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-12 : 09:45:28
how many rows does your table have in designer?
Go to Top of Page

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-12 : 10:28:20
One row.. Its a report with one table
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-12 : 10:36:10
quote:
Originally posted by bushfoot

One row.. Its a report with one table



then why use previous? just give a color for background and all the rows of data will have same bg color.
Go to Top of Page

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-12 : 10:43:49
I don't want all the rows to have the same color. For readability purposes I want the color to change after 4 rows. When you have a large report its easier to read that way. I am trying to figure out a way to do this. I see from some MSDN docs that Previous takes a Fields!Blah.Value. I dont think Previous is going to help me.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-13 : 00:53:49
quote:
Originally posted by bushfoot

I don't want all the rows to have the same color. For readability purposes I want the color to change after 4 rows. When you have a large report its easier to read that way. I am trying to figure out a way to do this. I see from some MSDN docs that Previous takes a Fields!Blah.Value. I dont think Previous is going to help me.


in that case isnt this enough

=IIF(((RowNumber("Yourdatasetname")-1)/4)%2 = 0,"White","Yellow")
Go to Top of Page

bushfoot
Yak Posting Veteran

53 Posts

Posted - 2008-12-15 : 11:15:16
Yep that works. Thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-15 : 11:21:06
cheers
Go to Top of Page
   

- Advertisement -