Focal Point
[SOLVED] Creating a dynamic SORT order

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6117016695

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,


7.6.9/7.7
Windows/OS 390
PDF/Excel
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


7.7.04
Win2K3, Unix
Oracle 10G,SQL2K,XFOCUS,ESRI,BID,MRE,SELF-SERVICCE
January 09, 2011, 02:53 AM
san250671
quote:
&SORT

Thanks Jimbo..


7.6.9/7.7
Windows/OS 390
PDF/Excel
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.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
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


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.
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.


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.