WebSpeed to Excell

stevenhellman

New Member
Recently I saw the following post & I am hopeful that you can show me where to place this code:

output-http-header ("Content-disposition","Attachment~; filename=abc.csv").
output-content-type ("application/vnd.ms-excel").

[I have pasted my procedure below]
-----------------------------------------------CUT-------------------------------

10 Feb 2002, 04:54 AM
Post #2

Tony Auerbach
Guest

The trick is to set the content-type to one associated with Excel in the browser, usually this would be something like application/vnd.ms-excel
instead of text/html. If you want to be sure IE launches an external instance of Excel instead of running it inside the IE window you can also send an HTTP header that specifies the file as an attachment and suggests a file name. Here is the code to do that.

output-http-header ("Content-disposition","Attachment~; filename=abc.csv").
output-content-type ("application/vnd.ms-excel").

Tony


-----------------------------------------------CUT------------------------------
/* excelsacust8_t.htm */
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Tappan Part Number Look up</TITLE>
<META http-equiv=Content-Type content="application/vnd.ms-excel; charset=iso-8859-1">
</HEAD>
<H5>
<CENTER>
<table border=0>
<caption><b>
<font face="Verdana" size=2>
Order Status & Previous Pricing
</font>
</b></caption>
<tr>
<th ALIGN="left"><Font size="2"><B>CUSTOMER</B></font></th>
<th ALIGN="left"><Font size="2"><B>QTY</B></font></th>
<th ALIGN="left"><Font size="2"><B>PART#</B></font></th>
<th ALIGN="left"><Font size="2"><B>NEC</B></font></th>
<th ALIGN="left"><Font size="2"><B>COLOR</B></font></th>
<th ALIGN="left"><Font size="2"><B>PRICE/M</B></font></th>
<th ALIGN="left"><Font size="2"><B>ORDER#</B></font></th>
<th ALIGN="left"><Font size="2"><B>LINE#</B></font></th>
<th ALIGN="left"><Font size="2"><B>ORD DTE</B></font></th>
<th ALIGN="left"><Font size="2"><B>STATUS</B></font></th>

</tr>
<script language="SpeedScript">
DEFINE QUERY q-work FOR order-line,order,customer.

IF (get-value("partnum")) = "" THEN
for each order-line where ORDER-LINE.part-no begins "1880ab8m" and ORDER-LINE.ul begins
"cm" AND order-line.ord-stat <> "shipped" and order-line.due-date > today - 700
no-lock , order of order-line no-lock,each customer of order WHERE (customer.name BEGINS
get-value("name")) no-lock by ORDER-LINE.PART-NO BY ORDER-LINE.UL BY order.order-date DESCENDING.
</script>
<FONT SIZE="-3">
<TR>
<TD ALIGN="left"><Font size="2"><B>`customer.name format "x(10)"`</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.qty format ">>>,>>9"`FT.</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.Part-no format "x(20)"`</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.ul format "x(10)"`</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.jkt-color format "x(5)" `</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.price-m format "$>>>>.99"`</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.order-no`</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>-`order-line.line-no format "99"`</B></font></TD>
<TD ALIGN="left"><Font size="2"><B>`order.order-date`</B></font><TD>
<TD ALIGN="left"><Font size="2"><B>`order-line.ord-stat format "x(3)"`</B></font></TD>



</TR>
</FONT>
<SCRIPT LANGUAGE="SpeedScript">
END.
</SCRIPT>
<TR><TD colspan="10"><FONT COLOR="BLUE">The End </FONT></TD></TR>
</TABLE>
</H5>
</BODY></HTML>
-------------------------CUT--------------------

Thanking you in advance
 
Top