Copy link to clipboard
Copied
with cfreport i can add some function to my report.
i would access to recordset (passed to cfr) for ordering it.
query to cfr -> ordering recordset in cfr -> print
is this possible?
thanks
Copy link to clipboard
Copied
Yes, this is possible.
For example, in the calling CFM file, add your parameter:
<cfreportparam name="prmOrderBy" value = "order by LastName">
Then, in Report Builder, add the following line at the bottom of the SQL query:
#param.prmOrderBy#
Naturally you wouldn't hard-code the "order by" clause, you would use a variable.
You could, of course, handle the query dynamically in your calling CFM file and pass the query result-set to the report so that the report does not run its internal query.