× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




No I didn't post any code. But here you go.


If you build this webpage as is, the browser will ask you to open or save
the document. just to see it in action put this were ever you can gain
access to it with your browser. The content-dispostion: attachment is
the key to getting it to download. This is just one way to do this. But
I'm sure that you could possibly get fancier and push and actual
spreadsheet. But I've never tried that method.

Content-type: text/html
Content-disposition: attachment; filename=SomeFileName.xls

<html>
<head>
<style>
/* you could add mso css here */
</style>
</head>
<body>
<table>
<tr>
<th>head1</th>
<th>head2</th>
<th>head3</th>
</tr>
<tr>
<td>detail1</td>
<td>detail2</td>
<td>detail3</td>
</tr>
<tr>
<td>detail1</td>
<td>detail2</td>
<td>detail3</td>
</tr>
</table>
</body>
</html>





--

Michael Schutte
Admin Professional



Bob Evans Holiday Farmhouse Feast, Serves 6-8 l $74.99
A complete homestyle meal TO GO, ready to heat at home, serve & enjoy!
Perfect for Thanksgiving, Christmas or holiday entertaining.
For more information, visit www.FarmhouseFeast.com



midrange-l-bounces@xxxxxxxxxxxx wrote on 01/21/2010 04:55:45 AM:

-----Message d'origine-----
[mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de
Michael_Schutte@xxxxxxxxxxxx

If you are serving an HTML page and you want to export to
excel, I've found that you can just add content-disposition
below the content-type.

Content-type: text/html
Content-disposition: attachment; filename=SomeFileName.xls


"attachment" tells the browser to download the page rather
than render it in the browser.

Just for some background (may not have anything to do with
this conversation).

I'm using CGIDEV2 to create my webpages. On my reports, I
have a link that says export to excel. When this link is
clicked, I run the same program again but only output the
table that holds the data to export. But because I have the
content-disposition in my top section, it asks me to either save
or open the file. I do not write out to the IFS at all.
Since the programs do not take long to run, it doesn't hurt
to rerun the program again to export to excel.

Michael,

I think you may have attached some code to your post, but it didn't
get through. I Would love to see some code.


Mike Cunningham wrote:

Someone in this string said something about using HTTP download
instead of IFS.

Someone? (!)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.