Webactions: generating excel-compatible CLP page

Andrew Philpot <[email protected]> Sun, 28 Mar 2004 21:43:28 -0800
Newsgroups gmane.lisp.open-source.franz
Message-ID <[email protected]>
I'd like to dynamically generate a CLP page which "lies" about its
content type (is syntactically HTML but says it's (:CONTENT-TYPE
"application/vnd.ms-excel")) so that MSIE will use its built-in Excel
viewer to display it.

I thought that something like

(webaction-project "myproject"
   :map
   '(("excelpage" "excelpage.clp"
       (:content-type "application/vnd.ms-excel"))))

where the content of the excelpage.clp is

  <HTML>
  <HEAD>
  <META http-equiv="content-type" content="application/vnd.ms-excel">
  </HEAD>
  <BODY>
  <TABLE>
  <TR><TD>Raphael</TD><TD>Sally</TD></TR>
  <TR><TD>Winfrey</TD><TD>Oprah</TD></TR>
  <TR><TD>Lake</TD><TD>Ricki</TD></TR>
  </TABLE>
  </BODY>
  </HTML>

should work.  If you drop this file onto Excel, it just "does the
right thing."  Of course in the real application, this would be
dynamically generated rather than static.  Also, I'm persuaded that
the embedded content-type declaration is probably ignored in this
case.

It doesn't do what I would like, however.  It just displays the table
normally, not as a spreadsheet.

I've tried other workarounds with little success either.  I'm open to
any reasonable workaround.  I started by trying .csv files, as I don't
really need an MS-only solution, but I do need to serve tabular
non-HTML data to a relatively naive user. For all I know, the content-type
incantation is all wrong.  Any suggestions would be appreciated.

Thanks,
Andrew