Closed placidopollicino closed 5 years ago
Yes, they work. What error did you get? Did you installed "zip" php extension?
If I try the example.php is giving me this error: "Impossibile apri il file 'example.xlslx' perchè ha estensione o formato non valido. Verificare che il file non sia danneggiato e che l'estensione corrisponda al formato del file." after I try to open file. I also tried the first 2 examples in the folder examples and is giving me this error: "Use of undefined constant ENT_XML1 - assumed 'ENT_XML1' in xlsxwriter.class.php on line 760"
Your last error makes me think that you are using an old version of PHP. ENT_XML1 was introduced in PHP 5.4.0 see https://www.php.net/manual/en/function.htmlentities.php
exactly... for the site I'm using I have 5.3.2.8. I'll try on 5.4 or above... What about the first error?
I don't know...
even in 5.4 is giving me the same first error...
I'm actually using 5.6.3.0
No PHP error displayed?
no... none... It prompt me for opening or saving as by design, but after I select open it's trying to open file, it can't and is giving me the error I wrote above...
maybe the file xlsx is empty?
why is empty? I'm running your example
I mean, maybe the writer is not working on your machine and the generated XLSX file is 0KB size?
In fact is 0 byte, but even with 0 byte excel should be able to open it if the format is valid
You are wrong. Excel always gives this error for 0-bytes files. So, your problem is: why is the file empty. I have no idea, you should debug the PHP code.
I'm using your example php file... maybe I was not clear about that... I tried now changing the filename from example.xlsx to example.xls and, even though is giving the error that format is different, is opening the empty file...
on the other end I enable this: "ini_set('display_errors', 1);" in your example.php and I'm getting an excel with this error inside: Warning: readfile(C:\Windows\Temp\xls76A.tmp): failed to open stream: No such file or directory in C:...\xlsxwriter.class.php on line 70
It sounds like your web application needs write permissions to your temp directory.
I'm sorry to report that I was not able use this class and the examples included are not working.