Is it possible to do the sorting of groups and get the top N groups (with the highest/lowest summary), programmatically? The top N number will be a parameter, and so is the order (ascending/descending). I've been trying but have not been successful.
From your question I will assume you are not using Crystal XI as this is possible in this version - you can put a parameter (prompt) in the TopN Sort Expert.
In previous versions - to show the Top or Bottom anything dynamically - you need to come up with a formula that will suppress the unwanted groups - there is a keyword in Crystal called "GroupNumber" - so if you sort the report from highest to lowest - and in the Section Expert set the formula for suppress to GroupNumber > {?Parameter}.
If Parameter = 10 then when group 11 comes it will be suppressed. Bottom N is the reverse.
To change the sort order - you would need the report sorted two ways - and place them both in a "shell report" containing nothing but parameters. Supress the subreport you don't want to see.
The other ways you can accomplish this is via stored procedures - where the database does all the work and sends the records in the correct order to Crystal which merely displays them.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.