Solved is it possible to sort a report by its conditional formatting? (1 Viewer)

ChrisC

Registered User.
Local time
Today, 20:01
Joined
Aug 13, 2019
Messages
90
Hello everyone!

As the title says... is it possible to sort a report by its conditional formatting? I have formatted the field to be either RED, Orange or Green and I would like to be able to sort the report with Red on top, then Orange and finally green.

Ability to then sort by other fields would also be useful.

many thanks
Chris
 

Minty

AWF VIP
Local time
Today, 20:01
Joined
Jul 26, 2013
Messages
8,899
Assuming you know what the conditional formatting rules are then you should be able to apply the same rules to the sort order in the report.
Note that in a report the sorting has to be done IN the report, not the underlying query or record source.

If you have to maybe add a field to the query that gives you the result the CF is based on, then sort on that.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:01
Joined
May 7, 2009
Messages
14,546
create a query from your table.
add an Expression to your query (same condition as with your fc), eg:

select switch([the condition for red], 1, [the condition for orange], 2, True, 3) As SortOrder, Field1, Field2 from yourTable
Order By 1;

on the Report also, sort by SortOrder (the calculated column).
 

ChrisC

Registered User.
Local time
Today, 20:01
Joined
Aug 13, 2019
Messages
90
Thanks as always for the replies guys. In the end I went with your suggestion Minty of simply adding a field to my query and sorted by that. Perfect!

thanks again!
 

Minty

AWF VIP
Local time
Today, 20:01
Joined
Jul 26, 2013
Messages
8,899
Glad you got it sorted!
Good Luck with the rest of your project.
 

Users who are viewing this thread

Top Bottom