Hi All!
I'm trying to put together a report in Crystal Reports 10. The report contains 3 groups. The third of them groups by a database field called 'description'. This is how the report looks when it's printed:
[tt] GROUP 1 VALUE 1
Group 2 Val 1
Animal Type Count %
Cats 15 20.3
Dogs 20 27.0
Fish 13 17.6
Hamsters 26 35.1
----------------------------
Total 74 100.0
[/tt]
The words Cats, Dogs, Fish and Hamsters are coming from that 'Description' database field I mentioned before, and my third group is based on this field. I placed the description field on the footer of group 3 and that's where those animal types are coming from. To get the count of each animal, I create a formula which I put in the details section. The formula simply says this:
[tt]
if storeId = x then
1
else
0[/tt]
where x is the Id of the store where the animals are (the report is supposed to print up to six stores side by side, and I have a different count formula for each store.)
Ok - so far so good!
Here's what I need. The list of animals is sorted by its description. I need to sort it based on the Count of animals in descending order. So, in the example above, the animals should be in this order:
Hamsters (26)
Dogs (20)
Cats (15)
Fish (13)
Any idea how to do it?
Thanks!
JC
_________________________________________________
To get the best response to a question, read faq222-2244.
I'm trying to put together a report in Crystal Reports 10. The report contains 3 groups. The third of them groups by a database field called 'description'. This is how the report looks when it's printed:
[tt] GROUP 1 VALUE 1
Group 2 Val 1
Animal Type Count %
Cats 15 20.3
Dogs 20 27.0
Fish 13 17.6
Hamsters 26 35.1
----------------------------
Total 74 100.0
[/tt]
The words Cats, Dogs, Fish and Hamsters are coming from that 'Description' database field I mentioned before, and my third group is based on this field. I placed the description field on the footer of group 3 and that's where those animal types are coming from. To get the count of each animal, I create a formula which I put in the details section. The formula simply says this:
[tt]
if storeId = x then
1
else
0[/tt]
where x is the Id of the store where the animals are (the report is supposed to print up to six stores side by side, and I have a different count formula for each store.)
Ok - so far so good!
Here's what I need. The list of animals is sorted by its description. I need to sort it based on the Count of animals in descending order. So, in the example above, the animals should be in this order:
Hamsters (26)
Dogs (20)
Cats (15)
Fish (13)
Any idea how to do it?
Thanks!
JC
_________________________________________________
To get the best response to a question, read faq222-2244.