Print Page | Close Window

to get TOP N records

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19468
Printed Date: 28 Apr 2024 at 3:25am


Topic: to get TOP N records
Posted By: achandana01
Subject: to get TOP N records
Date Posted: 25 Apr 2013 at 10:27am
Hi,

I am looking for top N rows in a report for that I go to report > group Sort expert

I selected the Top N from the drop down and put a parameter in the formula which allows me to select any number of top rows, however I am looking for something like this the parameters should allows me to select particular number of top procedures or all procedures I am wondering how to do code it in my report ? Please help.

Thanks,



-------------
chand



Replies:
Posted By: Sastry
Date Posted: 25 Apr 2013 at 11:38pm
Hi

What is

"select particular number of top procedures or all procedures I am wondering how to do code it in my report ? "

You mean.. stored procedurs if so, how can we say top procedures ?

If not stored procedurs then what is this give some example to understand better

-------------
Thanks,
Sastry


Posted By: achandana01
Date Posted: 26 Apr 2013 at 6:02am
Hello Sastry,

Procedures isn't really stored procedures it is a field in a table which I am using to group by in my report.

I would like like to setup a parameter which gives an option to select Top N or All(all records for that query irrespective of top rows).I know how to setup TOP N but not sure how to pass ALL.

Sorry about the earlier confusion, I hope this explains better.

Thanks,

-------------
chand


Posted By: Sastry
Date Posted: 29 Apr 2013 at 4:50am
Hi

There is only one way to do this is :

Create a static string type parameter, and in Top N condition evaluate it like ..

If isnumeric({Parameter}) Then
Tonumber({Parameter})
else
500000 // This is maximum values. If any user enters other than number 'All' or any other value then it will take 500000 number inplace of 'N'

-------------
Thanks,
Sastry



Print Page | Close Window