Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Showing formatted Excel File in a browser?
Message
De
23/05/2001 14:25:10
 
 
À
23/05/2001 14:18:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00510518
Message ID:
00510523
Vues:
13
>I have been asked to create some web based reports that will end up
>being Excel spreadsheets that need to be displayed in IE. For instance,
>I will have an on-line input page that will request a begin and end date
>range. Those range values will be used to create an Excel file. Now I want to display the Excel file in the browser (IE only is ok). I know that if I have a hyperlink to an Excel file on the web that it will show up in IE with no problem.
>
>How can I create an ASP app that will display the formatted Excel file once the VFP program finishes populating the Excel file? I got the following response from the west-wind site but it has not worked for me.
>
> You need to set the content type to "application/vnd.ms-excel" and return
> the contents of the file using Response.BinaryWrite().
>
>When I tried:
>
> response.contenttype = "application/vnd.ms-excel"
> cfile = "c:\temp\excel_file.xls"
> response.binarywrite(cfile)
>
>All that was returned to the browser was the filename 'c:\temp\excel_file.xls'
>
>Can this be done?
You have to send back a binary string:
lcStr = FILETOSTR(cfile)
response.binarywrite(CREATEBINARY(lcStr))
Mark
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform