[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

IE Export to Excel option not working with POSTed data

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
datastarstar
Asked:
datastarstar
1 Solution
 
Ray PaseurCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now