Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

php generated Excel Issue

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
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Korts

ASKER

I had already restored the backup & it works. I will do a compare; but I added code so it will be different.
Do you have WinMerge?  It makes the comparison task very easy.  http://winmerge.org/
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!
You're welcome, glad to help.