SET TALK OFF SET TEXTMERGE ON CREATE CURSOR cs (firstname C(20), lastname C(30)) INSERT INTO cs VALUES ("Bill", "Gates") INSERT INTO cs VALUES ("Steve", "Balmer") INSERT INTO cs VALUES ("Bill", "Clinton") cHtmlOutput="" TEXT TO cHtmlOutput NOSHOW ADDITIVE <table border=0 cellspacing=0 cellpadding=0> ENDTEXT SELECT cs SCAN ALL TEXT TO cHtmlOutput NOSHOW ADDITIVE <tr> <td width=100 valign=top><<ALLTRIM(cs.firstname)>></td> <td width=160 valign=top><<ALLTRIM(cs.lastname)>></td> </tr> ENDTEXT ENDSCAN TEXT TO cHtmlOutput NOSHOW ADDITIVE </table> ENDTEXT SET TEXTMERGE OFFThen use Response object, or whatever way you have to create output (print or echo in PHP), to send this output back to browser.
Response(cHtmlOutput)With those two headers in place, the browser will understande the whole transfer as a download of XLS file.