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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to prevent sorting by the parameter field

Status
Not open for further replies.

LMGroup

MIS
Apr 10, 2006
85
CA
I'm using CR8.5. The report I created has a parameter field set up for multiple discreet values. I want the report to generate using those values in the order that I entered them. Instead, the report is sorting them into numerical order before displaying them. I don't have any sorting set up for the report.

The values are generated from a stack of folders that don't have any rhyme or reason to their order. The report needs to print in the specified order because a sheet needs to be inserted into each of these folders and the task of sorting all the folders into numerical order first would be too time consuming.

How can I make it return the records in the order I request them?

Thanks,
Lorraine
 
See my faq on this:
__________________________________________
Sort Report in the Order of Multi_Valued Parameters
faq149-4505
Posted: 26 Nov 03

Assume your report accepts into a multi-value parameter called {?Customer_List} several customer numbers.
The report should show the customers in the order they were entered into the parameter.

Sort the report on the following formula, which computes for each Customer Code its position in the parameter value list:
------------------------------------------------------
NumberVar i ;
NumberVar N ;

FOR i := 1 TO UBound({?Customer_List}) DO
(
IF {Customer.Customer ID} = {?Customer_List} THEN
(
N := i;
Exit For ;
)
);

N;

------------------------------------------------------
Cheers,
- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks for the reply. Where does this fit into the report? I don't see anywhere to insert it for the parameter field. Do I create a formula field or put it in with one of the section formats?

Sorry for the confusion. I'm kind of flying blindly with this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top