June 11, 2004, 10:02 PM
vaayuDynamic Column sort
Can anyone help me with column-sorting on the fly where the user can click on a hyperlink on any column on the report(html) to re-generate the same report based on the field they click??
Appreciate ur help
Thanks
PK
June 12, 2004, 07:42 PM
GCohenIf you have subscribed to the OLAP option of WebFocus , then the absolute easiest way to sort any column of a displayed report is to just add the line ...
-OLAP ON
as the first non-comment line of the Focexec
June 14, 2004, 01:18 PM
<Grzegorz>You can also use the "self-drilldown" technique:
-*
sort.fex file:-* Sort order: HIGHEST or LOWEST:
-DEFAULTS &SORTORD='FIRST';
-* Previous sort column:
-DEFAULTS &PREVSRT='FIRST';
-* The SORTCOL column is used for sorting:
-DEFAULTS &SORTCOL='COUNTRY';
-* Set up the sort order appropriately:
-SET &SORTORD= IF &PREVSRT NE &SORTCOL THEN 'LOWEST' ELSE
- IF &SORTORD EQ 'LOWEST' THEN 'HIGHEST' ELSE 'LOWEST';
-*
TABLE FILE CAR
SUM SALES
BY &SORTORD TOTAL &SORTCOL NOPRINT BY COUNTRY
ON TABLE SET STYLE *
TYPE=TITLE, COLUMN=P1,
FOCEXEC=SORTS ( \
PREVSRT='&SORTCOL' \
SORTCOL='COUNTRY' \
SORTORD='&SORTORD'), $TYPE=TITLE, COLUMN=P2,
FOCEXEC=SORTS ( \
PREVSRT='&SORTCOL' \
SORTCOL='SALES' \
SORTORD='&SORTORD'), $ENDSTYLE
END
It is not so effortless like OLAP (especially in the real-life cases), but is more flexible and completely customizable.
June 14, 2004, 06:27 PM
susannahI agree with Gregorz.
I use this technique, and along with it, i put a mouseover on the column title
SUM DOLLARS AS
'[span title="click to sort by">Dollars[/span>'
and then the user knows what to do.
June 16, 2004, 09:11 PM
vaayuThank you guys for all ur suggestions! I got it working now.
Appreciate it
PK