Page refresh after Excel download quirk

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
brothaofdes
Forum Newbie
Posts: 21
Joined: Thu Jan 20, 2011 10:05 am

Page refresh after Excel download quirk

Post by brothaofdes »

I have a small program designed to export table data into Excel that has a strange issue.
Initially, the page will load with options to select a table view to export. When the user selects the option, the table data is extracted into an Excel file. On the first pass, this runs fine. BUT… when the user selects another option from the page, the browser will display a partial view of the plain html text.
What I think is happening is that after the Excel file is output, that the initial selection page is not being re-rendered and that there is a conflict between the Download header and the selection page.
I did a test on the page by setting an element to be visible on the user selection page by using a control variable. When the page initially loads, the variable is set to ‘ON’ and I reset this variable after the Excel is downloaded to ‘OFF’ (1 and 0). But, the element never clears after the Excel file is processed.
Has anyone ever seen this before? If so, what technique do you use to resolve this issue?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Page refresh after Excel download quirk

Post by Jade »

Are you setting the proper header each time you're triggering the excel export?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Page refresh after Excel download quirk

Post by John Cartwright »

Jade wrote:Are you setting the proper header each time you're triggering the excel export?
Post your download script. I would agree with Jade it sounds like your doing something funky with the headers.
Post Reply