Solved

Limit Number of Records Returned in Crystal Report

Posted on 2014-10-01
4
590 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now