General information
Category:
Internet applications
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only