Sorting of Report

niimodinniimodin Member Posts: 142
Hello Experts
I want to know if it is possible to sort a report with a non-table field.
If Yes how will it be done?

Example SSAmt from the function below:
CurrReport.CREATETOTALS(SSAmt)
Thanks

Comments

  • kapamaroukapamarou Member Posts: 1,152
    My solution would be to use a temporary table that can store an integer and all PK fields of your table. Declare it as temp, fill it, sort it and then create a report using an Integer dataitem and using your "buffer" as a source to select the correct record.

    Like.
    bufferTable.SETCURRENTKEY(some key);

    IF intRec.No = 1 THEN
    bufferTable.FINDFIRST ELSE
    bufferTable.NEXT;

    MyRealRecord.GET(bufferTableField1,bufferTableField2,...);
    ...

    In the body section print the contents of MyRealRecord.
Sign In or Register to comment.