Consultor Eletrônico



Kbase 13882: How to change sort order using _printrb Report Builder
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How to change sort order using _printrb Report Builder

This is an example of how to change the sort order.
What you need to do in Report Builder:
1. Define a calculated field: rtparam defined as:
RUNTIME-PARAMETER("rtparam").
2. Define a second calculated field to do sort on, mysort defined as:
IIF(RUNTIME-PARAMETER("rtparam")="1",name,string(cust-num,"99999"))

IMPORTANT: THE SORTS MUST BE THE SAME DATA TYPE, THAT IS WHY CUST-NUM
IS USING THE STRING FUNCTION

3. Define the sort on the mysort field.


run aderb/_printrb.p
("c:\sandy\73bdir\reports.prl",
"sortrpt",
"-db sports",
"O",
"",
"",
"D",
"",
"",
"",
1,
1,
9999,
no,
"",
yes,
yes,
no,
"rtparam=1").

/* What happens here, is that when rtparam = 1,
* then it will sort by name,
* if rtparam = 2 then it would sort by cust-num. */


Progress Software Technical Support Note # 13882