Hello Ido:
I found your post below and found it very helpful for a report I am working on. Currently using CR 10 PRO and datasources are DB2, MS SQL Server 2K and Oracle.
The report needs to have ability for users to enter Problem IDs and have the report sorted in the order the Problem IDs were entered. But if users want all Problem IDs (by entering a blank for the parameter selection) the report needs to be sorted by all Problem IDs in ascending order.
Is there a way to modify the formula to allow for this?
Thank you.
Formula Help
Sort Report in the Order of Multi_Valued Parameters
faq767-4506
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
I found your post below and found it very helpful for a report I am working on. Currently using CR 10 PRO and datasources are DB2, MS SQL Server 2K and Oracle.
The report needs to have ability for users to enter Problem IDs and have the report sorted in the order the Problem IDs were entered. But if users want all Problem IDs (by entering a blank for the parameter selection) the report needs to be sorted by all Problem IDs in ascending order.
Is there a way to modify the formula to allow for this?
Thank you.
Formula Help
Sort Report in the Order of Multi_Valued Parameters
faq767-4506
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