Solved

php generated Excel Issue

Posted on 2013-01-03
5
302 Views
Last Modified: 2013-01-03
We have a php program that generates a report from the database & creates an Excel Spreadsheet. The program runs multiple times per day & has been working for over a year.

Yesterday, I made some minor changes in the logic that generates the rows under specific conditions. The program now fails in IE & Chrome. In FireFox, it works. The program is attached.

In IE & Chrome, Excel issues the message in the attached image called rpt-error-ie.jpg. When you click OK, nothing happens.

In FireFox, you get SOMETIMES the message called rpt-error-ff,jpg and SOMETIMES you get the other one.

In FireFox, in BOTH cases, if you click OK, the report opens correctly in Excel. When geneated in IE or Chrome, it DOES not do anything.

Note that the message I called rep-error-ff has occurred in ALL 3 browsers always since the beginning. Clicking OK always works.

I recognize that the message is created by Excel.

Why is this happening?
rpt-error-ie.jpg
rpt-error-ff.jpg
report1.php
0
Comment
Question by:Richard Korts
  • 3
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38741270
Compare it to your backup copy and see what has changed.  Or just restore your backup copy.
0
 

Author Comment

by:Richard Korts
ID: 38741330
I had already restored the backup & it works. I will do a compare; but I added code so it will be different.
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38741481
Do you have WinMerge?  It makes the comparison task very easy.  http://winmerge.org/
0
 

Author Closing Comment

by:Richard Korts
ID: 38742301
WinMerge is a SUPERB tool! Found it right away.

FYI, I had put the Excel extension at "xlxs" on the new one; It was "xls" on the old (working) one.

I changed the new to xls; works like a charm!!

I guess the "marriage" between HTML "content type" & Excel is limited. As far as I know, my customer has the latest Excel; but maybe not.

Thanks & Happy New Year!
0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 38742383
You're welcome, glad to help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

13 Experts available now in Live!

Get 1:1 Help Now