January 08, 2011, 04:21 AM
san250671 [SOLVED] Creating a dynamic SORT order
I have to give end user an ability to decide SORT order of the report. I can put a list of fields on dropdown/list where user can multiselect the fields. I am not able to figure out how to use the selected ones in my program/fex
This message has been edited. Last edited by: Kerry , January 14, 2011 10:37 AM January 08, 2011, 01:23 PM
jimbo Something like this:
TABLE FILE CAR
SUM DEALER_COST
BY &SORT
END
Where &SORT value can be passed from the HTML page drop-down
January 09, 2011, 02:53 AM
san250671 quote:
&SORT
Thanks Jimbo..
January 09, 2011, 10:02 PM
Doug You can also add &SORT (If it's a user friendly / displayable value) to the TITLE and toggle it via DM to be used in a drilldown.
February 04, 2011, 02:15 PM
Joe Beydoun I guess I took this a bit further and have our users select the columns they want to display and the sort order using a double-list box in Composer.
The procedure code is this:
-DEFAULT &SORTLISTA = '''MODEL'' NONE ''TYPE'';
-SET &SORTOBJ1A = STRREP(&SORTLISTA.LENGTH, &SORTLISTA, 1, '''', 0, 'x', &SORTLISTA.LENGTH, A&SORTLISTA.LENGTH);
-SET &SORTOBJA = 'BY ' | STRREP(&SORTOBJ1A.LENGTH, &SORTOBJ1A, 4 , 'NONE', 2, 'BY', &SORTOBJ1A.LENGTH, A&SORTOBJ1A.LENGTH);
TABLE FILE CAR
BY &SORTOBJA
END
February 05, 2011, 11:59 AM
Doug I changed this a bit (corrected two syntax errors, it didn't work as written) and added HEADING and a few other things...
-DEFAULT &SORTLISTA = '''MODEL'' NONE ''TYPE''';
-SET &SORTOBJ1A = STRREP(&SORTLISTA.LENGTH, &SORTLISTA, 1, '''', 0, 'x', &SORTLISTA.LENGTH, A&SORTLISTA.LENGTH);
-SET &SORTOBJA = 'BY ' | STRREP(&SORTOBJ1A.LENGTH, &SORTOBJ1A, 4 , 'NONE', 2, 'BY', &SORTOBJ1A.LENGTH, A&SORTOBJ1A.LENGTH);
-SET &ECHO = ALL ;
TABLE FILE CAR
HEADING
"Sort Order: &SORTOBJA"
&SORTOBJA
ON TABLE SET PAGE OFF
END February 07, 2011, 09:58 AM
Joe Beydoun Thanks for the cleanup Doug, i free-form typed the code, never a good idea.