Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP to Excel in HTTPS 1

Status
Not open for further replies.

tklear

Programmer
Jan 16, 2003
37
0
0
US
I have an ASP page that uses:
Response.ContentType = "application/vnd.ms-excel"

After this command, I created a table in html. This opens an instance of Excel in the browser and loads the table into Excel as a spreadsheet (essentially anything after the response.contenttype command appears in Excel). This does what I want it to do under http.

The only problem is, when I moved it to an SSL environment to test it doesn't work and I'm trying to see if there's a work-around or different syntax to adjust for ssl. Apparently the Excel application can't decrypt the SSL encryption?

Does anyone know if there's a way to make this work under HTTPS?

Thanks.
 
Are you using IE 6 as your browser? If you are, it might be a browser setting.

In IE, go to the Tools/Internet Options menu, click the Advanced tab and go to the Security section. Make sure that the "Do not save encrypted pages to disk" option is checked.

I know that this solves a similar issue when the content type is PDF, so perhaps this will solve Excel issues too. It's worth a try anyway :)

Let me know if this works,
Cathy
 
Thank you so much. That setting does the trick even though I'm using IE 5.0.

Too bad all the standard images come with this setting unchecked. I'll have to write some instructions for the users to change their setting but otherwise I should be back in business!

Thanks again.
 
tklear - can you elaborate just a bit on how to write the table to excel? I need to generate a daily excel report on my site that is emailed as an attachment to my managers. So, I'd have to create the spreadsheed, write the data to it, save it, and then email it as an attachment (which I can handle no problem). Can you provide any insite on the first three steps? Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
 
mwolf00 - you might want to check msdn.microsoft.com for Knowledge Base articles KB271572 & KB199841. These show samples of basically what I did.

After the command:
Response.ContentType = "application/vnd.ms-excel"
you can literally put a table like:
<table>
<tr><td>1a</td><td>1b</td></tr>
<tr><td>2a</td><td>2b</td></tr>
</table>

and this will stream to Excel in the browser (Excel menu options will be present).

For the rest of your question, I never saved and attempted an attachment so you might have to research a little more. I thought I saw something about response.header that may pertain to an attachment and for saving files to disk you can use fso (file system object).

Hope that gets you going in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top