Solved

Limit Number of Records Returned in Crystal Report

Posted on 2014-10-01
4
595 Views
Last Modified: 2014-10-02
I'm creating an Inventory report of fast moving parts. This is needed by our Parts manager to gain a better understanding of his inventory and to know which manufacturer "Bulk Buy Specials" to take advantage of.

Some parts categories (like Suspension parts) will require a list of the top 10 fastest moving parts while other categories (like Cargo Control) might require a list of the top 25 fast movers. I've created a numeric parameter field so those running the report can enter the number of top fastest moving parts to be returned. The problem is I don't know how to limit output to that number.

The report is already sorted to display Quantity Sold in descending order. How then do I limit the number of records returned to the number entered by the user?
0
Comment
Question by:Bad_Fish
  • 2
4 Comments
 
LVL 18

Assisted Solution

by:vasto
vasto earned 250 total points
ID: 40356033
If you can add to Record selection formula

RecordNumber <= {?NumberOfRecords}

where {?NumberOfRecords} is your parameter


RecordNumber is an internal number generated by Crystal for each record
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 250 total points
ID: 40356280
You can also use a TOP N report if you group on the part type.

mlmcc
0
 

Author Comment

by:Bad_Fish
ID: 40357692
The TOP N feature did the trick. When I first tried RecordNumber <= {?NumberOfRecords} as suggested by vasto, I received the dreaded "This function cannot be used because it must be evaluated later" error. No doubt this has something to do with how I assembled the report so I'm crediting vasto with the assist. Thank you both!
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40357732
It has nothing to do with how you built the report.  RecordNumber is not available until the Printing pass through the report after filtering is done.

mlmcc
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal 2013 - Using Can Grow adds spaces in text 9 61
Crystal Reports CSV data source, field types 6 102
Parameter transfer to cristal report 3 77
Crystal Report for VS2013 17 105
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question