?
Solved

Limit Number of Records Returned in Crystal Report

Posted on 2014-10-01
4
Medium Priority
?
624 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 1000 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 1000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

762 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