Date:  08/24/2008 10:55:54 PM Msg ID:  003778
From:  FoxWeb Support Thread:  003777
Subject:  Re: To Stream an Excel Doc like a PDF
Are you trying to create the Excel file from your FoxWeb script, or are you trying to simply return a pre-existing file? If you are trying to create the spreadsheet file, you have a couple of options:
 
  1. Use the COPY TO TYPE XLS/XL5 command\.  For details take a look at the documentation of the COPY TO command.
  2. Use the excel.application COM object. I do not have personal experience with this, so you will have to do some research on the web.
The page http://fox.wikis.com/wc.dll?Wiki~ExcelAutomation~VFP may also be helpful to you.
 
Once you have your excel file (or if you are serving a pre-existing Excel file), then again you have two options:
 
  1. Save it to a location that is accessible directly from your web server and use the Response.Redirect command.
  2. Return the file data with the Response.Write object, after setting the content type to right mime type for Excel documents (see below).This technique is described in the "Returning Non-HTML Content" section of the Returning Content to the Browser topic of the FoxWeb documentation.
I've seen the following mime types for .xls files, but I'm not sure which one works best.  You should do some Googling, or experiment to find out which works best:
 
The samples are installed in the default program root. This location will vary, depending on the version of FoxWeb you are using. If you haven't changed it, then you can find it in the Virtual Servers tab of the FoxWeb Control Center. For FoxWeb version 3.x the default program root is in \Program Files\FoxWeb\Programs. For FoxWeb version 4.x the default program root is in a sub-folder of the shared documents folder. In Vista this folder is located at C:\Users\Public\Documents\FoxWeb\Scripts. In other operating systems it may be in c:\Documents and Settings\All Users\Shared Documents.
FoxWeb Support Team
support@foxweb.com email
Sent by George Gambill on 08/24/2008 02:23:35 PM:
We want to send an Excel spread sheet to the client much like FoxWeb can with a PDF.

Any suggestions?

Also, I can't find the Upload.fwx sample script whick is supposed to be installed in the examples sub-directory of my program root.  Where is the program root???