Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Defined Sorting Method for Complex Formulas

Status
Not open for further replies.

skibear99

Instructor
Dec 29, 2003
3
US
This is the overall scenario:

I have an A/R aging report summarizing data by the Customer Field.

I want the End-user to decide which of these fields they want to sort by at the time they run the report:

1. Average Aging of Invoices
2. Total Owed
3. Total Owed over 90 days.

The issue is that these values are calculated during the second pass, and I'm not sure how to utilize the "Whileprintingrecords" function in order to perform another sort.

Let me state categorically that I'm fully aware of creating a Field called @SORT_ORDER and having that determined by a User-Entered parameter and sorting on that basis for the group. This IS NOT the issue.

The problem is sorting upon the value after it has been grouped and summarized.

I also know that I could easily combine the 2nd & 3rd sorts into 1 report. The problem is how to sort based upon an Average, while also sorting that same group by a summary value.
 
You could build a container report which holds 2 or 3 subreports.

The user parameter then just activates the section holding the subreport with the sort order you want.

The subreports in suppressed sections will not run. The only drawback is if you want to make a change to the report you have to modify all 3 subreports.

Ian
 
Another method is an SQL Command, that can merge data from several sources.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top