corrupt data in excel

stevenlips 17 Aug, 2009
Hello,

when I export the database as an excel-document, some how not all records are exported correctly. Of some records, no data is being exported, while other records are doing fine. For details, please see the attached excel-sheet, it should give 36 records with each 13 elements. As you can see, of record 35 (line 26) things go wrong.

Does anyone see what is happening here? Many thanks!
GreyHead 17 Aug, 2009
Hi stevenlips,

Looks like it breaks in the middle of this uid
IZjViZTkwZmZiYjJjb50?8?6?8?b?1?0?d?d?0?4?d?4?1?a?
What's the correct value?

If you edit the uid does it then export correctly?

Bob
stevenlips 18 Aug, 2009
Hi Bob,

thanks for the quick reply. The uid of this record (cf-id 35) should be
INjBiYjQ3ODI4MzA08c5b986bb7a81d6604b1c6825f460158
instead of the I
ZjViZTkwZmZiYjJjb50?8?6?8?b?1?0?d?d?0?4?d?4?1?a?
it is generating now.

how can I change the uid of this record (pls forgive this noob:))?
GreyHead 19 Aug, 2009
Hi stevenlips,

They look like completely different UIDs to me. The UID is just a random string to you can change them by editing the table directly without causing any side effects (unles you've used the UID somewhere else).

Email me a backup copy of the database table if you like and I'll look at it when I have a moment.

Bob
chrpeder 24 Aug, 2009
I have the same problem with corrupt data when exporting to excel.

running joomla 1.5.14 and chronoform 3.1 RC5.5
stevenlips 24 Aug, 2009
Hi Bob,

sorry for my late reply. I have troubles accessing the database, but think this will be solved tonight and will send you back up asap.
chrpeder 27 Aug, 2009
Any news on the subject? Both "Backup to excel" and "Backup to CSV" produce a corrupt file.

Excel tels me: "xxxx\Desktop\xmlxls57\XMLtoXLS.xla not found"

When I press "ok" it tells me that there is content in the file that cannot be read and if I want to recreate the content.

yes result in a currupt file
GreyHead 28 Aug, 2009
Hi chrpeder,

I've no idea. Both exports work Ok for me. I can only suggest that something in your site permissions, the data, the character sets or the Excel setup is giving the process indigestion.

Exporting to CSV should give you a readable text file that may give you more clues.

If you can't export to CSV then it's probably a permissions problem with the temp folder.

Bob
stevenlips 28 Aug, 2009
The weird thing is that de error is only in the excel-document, not the CSV-doc. So, problem is solved for me, as I can use the CSV just as well.

Thanks Bob
GreyHead 28 Aug, 2009
Hi stevenlips,

The Excel exporter (which comes from the Pear library) is much more complex and something relatively small can trip it up.

Bob
chrpeder 14 Sep, 2009
My install still does not work. I tried it at two different hosting providers.

Given that this is a component I payed for I expected that the export to excel functionality would work. But I can see in this forum that I am not the only one having problems exporting to excel.

So I ask: are there any plans to fix this problem or should I start to look for another component?
GreyHead 15 Sep, 2009
Hi chrpeder,

As I said before it's most likely something to do with either the site setup or the data you are downloading. ChronoForms uses the pretty standard PEAR ExcelWriter code to create the spreadsheet.

The only error message you have posted refers to the \xmlxls57\XMLtoXLS.xla XML to Excel converter on your desktop which is nothing whatsoever to do with ChronoForms as far as I know.

Bob
chrpeder 15 Sep, 2009
What could be wrong with the setup of the site? All other components work fine. Are there components that chronoforms must not be installed together with?

The data I try to download are generated by Chronoforms - so what can be wrong there?

Both Excel 2007 and Excel 2003 cannot open the file.
GreyHead 15 Sep, 2009
Hi chrpeder,

I'm sorry, I don't do mind-reading. If all you tell me is "it's broken" then there is nothing that I can do about it.

ChronoForms is trying to create an Excel file but it's doing it from your data and that could be complete rubbish. I've no idea. Or you could be generating PHP errors that are being included in the file - that's a common problem.

Bob
chrpeder 16 Sep, 2009
Export via phpadmin works fine, but it is not a solution for clients.

Are there anyone who can help me getting chronoform to work or maybe anyone know a component that works?
GreyHead 16 Sep, 2009
Hi chrpeder,

ChronoForms XLS export works; export to csv works* - happy to help but can't do it by telepathy.

Bob

* I just built an app that is exporting from a very complex database to Excel formatted csv, zipping and FTP ing the file to a third party site. The results open smoothly in Excel so it is all possible.
chrpeder 16 Sep, 2009
Well it still does not work on my install. I need pro help for this. PM with an offer if you can help me.
txo 17 Sep, 2009
Hi to all,

I've had the same problems with corrupt data in excel sheets that were build with the Excel Writer class. After hours of research I found out that the problem is memory related. Just try to limit the query and you will find out that the export works fine and your data is not corrupted.

Seems that the memory issue only happens with the 'pear' version of the Excel Writer class. On the internet I found a stripped version of this class without the pear stuff in it. For me this was the sollution. Maybe you guys at ChronoEngine would like to try the class. It can be found at http://pizzaseo.com/php-excel-creator-class.

To use, rename the excelwriter folder in e.g. _excelwriter. (can be found in the administrator/components/com_chronocontact folder)
Create a new excelwriter folder and unzip the excel.zip file in it.
That's all, everything should be working fine now.

Kind regard

Erik Smit
Fabbro Internet
The Netherlands

UPDATE!!
Just found out that the problem can also be solved by disabling the line
$xls->setVersion(8)
.
Can be found in admin.chronocontact.php around line 1590.
GreyHead 18 Sep, 2009
Hi Erik,

Thank you - extremely useful.

It had also occurred to me that it might be useful to have to option to write to an Excel file on the server rather than just for immediate download which presumably requires building the file in memory??

You can do this by adding a path and filename to the 'new Spreadsheet' command but it may need a little supporting code.

Bob
imfritzy 24 Jul, 2010
Hi Txo,

I tried your solution, but perhaps I'm not following your steps exactly.

I downloaded the alternative excel files that you suggested ("excel-2.0"), I created a new folder within admininstratot/components/com_chronocontact called excel-2.0 and I transferred all downloaded files into there. I changed all references to "excelwriter" in the admin.chronocontact.php file from excelwriter to excel-2.0, and then I tried to export some records to Excel.

I received the following error message on my Excel spreadsheet:

<b>Fatal error</b>: Call to undefined method Spreadsheet_Excel_Writer_Format::setColor() in <b>/home/alcottde/public_html/administrator/components/com_chronocontact/admin.chronocontact.php</b> on line <b>1595</b><br />

Did I follow your steps correctly? If not, please give me exact instructions because I'm likely to mess up again.

Thank you.
schlogo 14 Jan, 2011
Hello

Sorry to up this old thread, i have the same issue with the export function. Sometimes the excel files are corrupted , sometimes i only get empty 0ko files. I tried to replace the excel writer with no luck
schlogo 14 Jan, 2011
has anyone got the none pear excel library working ? if i replace those files, i just get a blank page when trying to export. So far...

- Changed the $xls --> setVersion(8) - Not working
- Removed basedir --> not working
- Changed XL libray files -- > not working

If anyone has an idea, i buy it. Csv is working fine but is useless in this case :-/
GreyHead 14 Jan, 2011
Hi schlogo,

I don't think I've ever had to use the 'non-Pear library'; I've always got exports working with the Pear version that ChronoForms uses.

It's hard to know what problem you are getting; we've seen character set problems, memory timeouts, corrupt data. Do you see any pattern in the errors?

Bob

I wrote up much of the stuff from this thread and the results of a client project to export many thousands of records in a document that was intended for The ChronoForms Book but ended up as an 'extra'. You can buy it here.
This topic is locked and no more replies can be posted.