This topic is locked
[SOLVED]

 Excel Export

3/8/2019 6:09:33 AM
PHPRunner General questions
T
tisento author

Hello,
i do have massive problems with exports to Excel 2007. Even an export of list page connected to a single table does not work (no matter if raw data or formatted data.
Opening the exported excel file ends with an error message by MS Excel:

"The file abc.xlsx can not be opened by Excel because the file format or file extension is invalid. Check if the file is corrupted and if the file extension matches the file format."
Is there a need, to include special libraries/functions in php.ini?
I use latest build auf phprunner 10.1 with build in phpspreadsheet, no modifications.
Exports to word or as csv are fine without any errors.
Thanks.

fhumanes 3/11/2019

You do not have to include anything, PHPRunner already adds PHPExcel which is what it uses to make Excel files.
I tested it on Build 32566, and it worked well for me.

admin 3/11/2019

Open that abc.xlsx file in Notepad. It may contain an error message that will point you in the right direction.
Most likely ZIP extensions is missing in PHP settings.

lefty 3/12/2019



Open that abc.xlsx file in Notepad. It may contain an error message that will point you in the right direction.
Most likely ZIP extensions is missing in PHP settings.


Are you using the built in export of PHPrunner 10.1
[color="#1C2837"]
[color="#1C2837"][font="arial, verdana, tahoma, sans-serif"][size="2"]2. If Not have you tried to repair the file in Excel? Excel can open quite a few versions so try older ones also.[/size]
[/url][/size][/font]
[font="arial, verdana, tahoma, sans-serif"][color="#1c2837"][size="2"]4. Click [/size]here for inspiration[size="2"]. Reason being at one point when xlsx first came out you could not open certain xlsx files as they were read only or had compatibility issues as to the way they were designed with older versions etc..... other issues. So you had to save them to another format and then open.[/size]
[font="arial, verdana, tahoma, sans-serif"]

[font="arial, verdana, tahoma, sans-serif"]

T
tisento author 3/13/2019

Thanks for your help. But still no excel export possible.
I use the newest Office 365 from monthly channel.

I use windows 10.

I use xampp version 703.

I included the path for extensions in php.ini

extension_dir = "C:\xampp703\php\ext"



as well as i activated

extension=php_zip.dll


i opened the corrupt xls-file with excel "open&repair". Same error as above.

i opened the file with "open&repair" and "extract data". Result "can't open".

i opened the with notepad++ and got an error: "exception reason bad allocation".
i don't know how to save in an older version, because i can only save in the format offered by phprunner. And that file i can't open for saving/exporting in another format.

i opened it with libreoffice. same result, corrupt file.
What is wrong with me or my phprunner?
Do i need to reinstall phprunner? Or any other suggestions?
THANKS.

admin 3/13/2019

You need to contact support directly.
We would need to have more info on the following:

i opened the with notepad++ and got an error: "exception reason bad allocation".

T
tisento author 3/14/2019

Hello,
now i tried to export a very simply single table with just 3 columns and 2 rows.
The exported excel file is still corrupted, but with the "open&repair" option i can now see the correct data in my sheet.

The excel error log says:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><logFileName>error195800_01.xml</logFileName><summary>Fehler in Datei 'D:\Downloads\employee.xlsx'</summary><additionalInfo><info>Excel hat die Überprüfung und Reparatur auf Dateiebene abgeschlossen. Einige Teile dieser Arbeitsmappe wurden repariert oder verworfen.</info></additionalInfo></recoveryLog>


Which means in english:
Error in file

Excel has completed file-level validation and repair. Some parts of this workbook have been repaired or discarded.
By the way, i now can open this simple structured xls with notepad++ without any error. But there is no hint in the opend file, what might be wrong with corrupted excel file.
Is there any way to upload my xls? Maybe one of you finds a hint!
Can i be, that i use the wrong php_zip.dll? I downloaded from here

pecl.php.net/package/zip/1.13.4/windows
and tried PHP 7.0 Thread Safe (TS) x64

as well as PHP 7.0 Thread Safe (TS) x86

T
tisento author 3/28/2019

Hello,
Everything is fine now.
PHP and the PHPRunner work fine with ANSI and UTF-8.
So i can use UTF-8 (not the other ones with or without BOM).
I just checked all my files, and just the two were miscoded: the one with the 3 empty lines after closing ?>

and the one with UTF-8-BOM.
Small errors big effect.
Thanks.