August 15, 2009 at 7:13 pm
Hi,
I would like to sort data in the report after it is retrieved from the data source. I'd like to set sort expressions on a Tablix data group. For example, to sort on the field [Transactions] in the order below. Need expressions example to use in the sort properties.
Transactions
-----------------------------
Express KOA In State Move In
Express KOA In State Move Out
Express Out of State
Manual KOA In State Move Out
Manual KOA In State Move In
Manual Out of State
Thanks in advance for any help.
-Baaul
August 17, 2009 at 8:34 am
Use
Properties ? Sorting ? Expression (Fields!Transaction.Value) ? Direction (Ascending)
August 17, 2009 at 9:46 am
Actually, it's not in order ASC. I'd like it to be in the order below...AScending won't work.
Transactions
-----------------------------
Express KOA In State Move In
Manual KOA In State Move Out
Express KOA In State Move Out
Manual KOA In State Move In
Express Out of State
Manual Out of State
August 18, 2009 at 12:38 am
Its better to keep the seperate column (SortOrder) in your table for sorting. and assign the values in table like below
Transactions SortOrder
----------------------------- -----------------------------
Express KOA In State Move In 1
Manual KOA In State Move Out 2
Express KOA In State Move Out 3
Manual KOA In State Move In 4
Express Out of State 5
Manual Out of State 6
Now sort the table based on Fields!SortOrder.Value
Properties ? Sorting ? Expression (Fields!SortOrder.Value) ? Direction (Ascending)
August 18, 2009 at 7:04 am
August 20, 2009 at 8:35 am
If you dont want to change the query or dont want to add the fields..
and if your results are constant with the names..
then try the following in the SORT expression: and sort order is AtoZ
=SWITCH( Fields!Transactions.Value= "Express KOA In State Move In", 1,
Fields!Transactions.Value= "Manual KOA In State Move Out",2,
Fields!Transactions.Value= "Express KOA In State Move Out",3,
Fields!Transactions.Value= "Manual KOA In State Move In",4,
Fields!Transactions.Value= "Express Out of State",5,
Fields!Transactions.Value= "Manual Out of State",6 )
August 20, 2009 at 9:24 pm
Thanks ! This is what I wanted. I wanted the sorting done with report side expressions. This will do the trick
-baaul
February 3, 2010 at 12:45 pm
Did that work for you? I need to sort AtoZ then blanks at the end, but
I cant get this to work:
=SWITCH(Fields!ALF.Value = " ", 2,Fields!ALF.Value like "%",1,)
February 3, 2010 at 1:07 pm
Try adding this sort expression.
=IIF(IsNothing(Fields!ALF.Value),"ZZZZZZ", Fields!ALF.Value) Sort order AtoZ
February 3, 2010 at 1:14 pm
That is what I did in the Crystal report equivalent, but it didnt work here. It says the expression is invalid. I also tried this: =Switch(IsNothing(Fields!ALF.Value),"ZZZZZZ", Fields!ALF.Value) but it returned nothing.
February 3, 2010 at 1:17 pm
Use the IIF instead of Switch
February 3, 2010 at 2:15 pm
Thank you! This worked, the field was really a space.
=IIF(Fields!ALF.Value = " ","ZZZZZZ", Fields!ALF.Value)
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply