Sorry, I have made a mistake with the post below. I have posted the ORDER BY from the wrong place. The actual order elements are coming from the parent task as you described, However, the asc / desc problem is documented correctly.
-------------
I've done some tests and I think there is something more going on with this. By logging the SQL queries I can see what ORDER BY statement is being generated:
On initial entry to the list screen the order by clause is being taken from that in the task definition - the ASC is being added by the framework:
ORDER BY branch.branch_id, branch.syllabus_type_id, grade.seq, exam.related_exam_id, exam.related_exam_seq, candidate.last_name, candidate.first_name asc LIMIT 10 OFFSET 0 =>Count=35
When I run the PDF output (a navigation button from the list task) the first time it uses the order defined in the task definition, again with ASC appended by the framework:
ORDER BY exam.branch_id, exam.syllabus_type_id, exam.related_exam_id, exam.related_exam_seq, candidate.last_name, candidate.first_name asc =>Count=35
On clicking RESET, the query generated for the list task is identical to previous as expected. The order for the PDF output task is also the same, except that now the framework has appended DESC to the query instead, thus reversing the order:
ORDER BY exam.branch_id, exam.syllabus_type_id, exam.related_exam_id, exam.related_exam_seq, candidate.last_name, candidate.first_name desc =>Count=35
Something in the RESET operation is causing the sort to change from asc to desc.
[Updated on: Tue, 03 November 2009 09:10]
Report message to a moderator