I was trying to find a solution to make it possible to select how a report is sorted before running it. Perhaps we could have a table sorter on tables generated by reports? I tried using the placeholders to provide a pull down with search options, but this didn't work. The replaced text is always in quotes, so the generated sql will not work: select concat(surname, ", ", firstname) as Name, cardnumber from borrowers order by 'cardnumber desc'
This is a bit kludgy, but I believe it works: Report for patrons w/ emails: SELECT cardnumber, surname, firstname, email, dateexpiry, dateenrolled FROM borrowers WHERE email IS NOT NULL AND email!= '' ORDER BY CASE WHEN @SortOrder:=<<Search order>> = 'dateexpiry' THEN dateexpiry WHEN @SortOrder= 'cardnumber' THEN cardnumber END Official column names have to be used rather than something more user-friendly, but otherwise it's