I have a report (using CR 9) that's bringing in all data for clients sorted by the highest balance. I want to be able to show on the report all clients if no parameter is entered, or show the top # clients (highest balance) based on the parameters entered. How do I accomplish this? By the way, the balance sort is done on the server, so I just need the first {?} records.
I tried to make a count using a running total and called it Rank. In the details x+2 suppress section I put in the formula: IF {?txtTop} <> 0 then {#Rank}>{?txtTop}
this accomplishes the visual aspect...showing only the clients I want to see...but then the totals in the report footer are wrong. it sums all records, even those that are suppressed. so my question is how to get the accurate totals using my current method, or if there exists another method that would be easier altogether?
Show all (no paramter entered):
Rank Client Balance
1 12345 $ 5000.00
2 24354 $ 3500.00
3 54366 $ 2000.00
4 23456 $ 1000.00
5 65745 $ 500.00
Total $12000.00
Show top 3 ({?txtTop}=3) THIS IS WHAT I WANT
Rank Client Balance
1 12345 $ 5000.00
2 24354 $ 3500.00
3 54366 $ 2000.00
Total $10500.00
Show top 3 ({?txtTop}=3) THIS IS MY CURRENT RESULT
Rank Client Balance
1 12345 $ 5000.00
2 24354 $ 3500.00
3 54366 $ 2000.00
Total $12000.00 (it totals suppressed values)
I tried to make a count using a running total and called it Rank. In the details x+2 suppress section I put in the formula: IF {?txtTop} <> 0 then {#Rank}>{?txtTop}
this accomplishes the visual aspect...showing only the clients I want to see...but then the totals in the report footer are wrong. it sums all records, even those that are suppressed. so my question is how to get the accurate totals using my current method, or if there exists another method that would be easier altogether?
Show all (no paramter entered):
Rank Client Balance
1 12345 $ 5000.00
2 24354 $ 3500.00
3 54366 $ 2000.00
4 23456 $ 1000.00
5 65745 $ 500.00
Total $12000.00
Show top 3 ({?txtTop}=3) THIS IS WHAT I WANT
Rank Client Balance
1 12345 $ 5000.00
2 24354 $ 3500.00
3 54366 $ 2000.00
Total $10500.00
Show top 3 ({?txtTop}=3) THIS IS MY CURRENT RESULT
Rank Client Balance
1 12345 $ 5000.00
2 24354 $ 3500.00
3 54366 $ 2000.00
Total $12000.00 (it totals suppressed values)