Solved

Limit Number of Records Returned in Crystal Report

Posted on 2014-10-01
4
613 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 101

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 101

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

695 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