Solved

IE Export to Excel option not working with POSTed data

Posted on 2012-04-11
1
327 Views
Last Modified: 2013-11-19
I have a dynamic html page (created by a cgi script) that I'd like users to be able to right click and use IE's built-in "Export to Microsoft Excel" option.  This works on a static page, but not when any form variables are passed to the script.

The following is a simple example where the username and password are set as hidden variables.  This is not actually what I'm trying to accomplish, but illustrates the problem.

http://www.surveystar.com/test/test_counts.htm

If, instead, the variables are passed in the URL, it works fine (like this link):
http://www.surveystar.com/cgi-local/basicdemo_counts.cgi?username=datastar&password=datastar

It seems the problem is that IE re-loads the page before it exports, dropping any POSTed form variables.  Is there any way around this (other than a custom routine that exports to Excel) -- I'm really looking to allow users to use the built-in function.

Thanks in advance!
0
Comment
Question by:datastarstar
1 Comment
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
When I have done this sort of thing, I have written out a CSV file on the server and given the client a clickable link.  The CSV file extension is almost universally associated with Excel.  When they click the link, a spreadsheet opens.  This seems to work correctly on all modern versions of Windows and is browser independent.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now