Focal Point
Sorting the report output

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

August 15, 2005, 03:17 PM
MADDY
Sorting the report output
Hi,
Is it possible to sort report by columns in the report output that is suppose in my car report output if i click on model then the whole report should be sorted by that field and similarly if i click on the field country it should be sorted by country.thanks for ur suggestions
Maddy
August 15, 2005, 03:24 PM
Tim J
Maddy:<br /><br />You can turn the OLAP option on for your report and each column will have active sort arrows at the top of each column, or you can use this tip posted previously:<br /><br /> https://forums.informationbuilders.com/eve/forums/a/...791077331#1791077331 <br /><br />Hope this helps,<br /><br />Tim

This message has been edited. Last edited by: <Mabel>,
August 15, 2005, 03:59 PM
Kamesh
Yes, you can sort the report by columns.

-* File test.fex
-DEFAULT &SORTFLD='COUNTRY';
-DEFAULT &DIRECTION='LOWEST';

-SET &DIRECTION = IF &DIRECTION EQ 'LOWEST' THEN 'HIGHEST' ELSE 'LOWEST';

TABLE FILE CAR
PRINT COUNTRY MODEL BODYTYPE DEALER_COST
BY &DIRECTION &SORTFLD NOPRINT
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE=TITLE, COLUMN=P1, FOCEXEC=TEST.FEX(SORTFLD='COUNTRY' \
DIRECTION='&DIRECTION'),$
TYPE=TITLE,COLUMN=P2,FOCEXEC=TEST.FEX(SORTFLD='MODEL' \
DIRECTION='&DIRECTION'),$
ENDSTYLE
END
August 15, 2005, 07:14 PM
MADDY
HI KAMESH,
thanks for ur reply i tried ur code but when i am clicking on the column instead of displaying the report sorted by that column its displaying code of the report. do i need to make any specific changes to the code u have sent before running it and any further suggestions are very helpful.
thanks maddy
August 15, 2005, 07:54 PM
Francis Mariani
Make sure you save the code Kamesh posted as a fex called "test". The program works correctly for me.
August 15, 2005, 07:57 PM
Kamesh
save the code as test.fex
August 16, 2005, 12:06 AM
MADDY
HI KAmesh/Francis,
i saved the code as test.fexand then ran the code its displaying the output but when i click on country instaed of sorting the report on country and displaying the report its displaying the code of the report.thanks for ur time and patience
maddy
August 16, 2005, 12:17 AM
MADDY
THANKS KAMESH ITS WORKING NOW SORRY FOR THE TROUBLE AND TAHNKS FOR UR SUGGESTION
October 05, 2005, 03:19 PM
Tim J
Maddy:

I am getting the same results as you were, where the code is displayed on the screen when the column title is clicked.

What change to the code did you make to correct this?

Thanks,
Tim