have you tried to simple pass the multirow you get from the database to an include file? You can do the formating in the included adp file. Look at the docs at your server at:
yourserver/doc/acs-templating/tagref/include.html