KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

On export to excel Greek strings are replaced by FALSE #644

Closed Ant Klad opened this topic on on Feb 1, 2019 - 5 comments

Ant Klad commented on Feb 1, 2019

I have a report which uses the WIN1253 (CP1253) character set. When I use export to excel I have the following problems : 1. When excel opens the file I get the message that the file format and the file extension do not agree and that probably the file is corrupt. When I open the file it shows the data except the Greek strings 2. All Greek strings (win1253) are replaced with FALSE.

KoolReport commented on Feb 2, 2019

I will ask the dev.team to investigate this issue.

Ant Klad commented on Feb 5, 2019

Is there any news on this? It is something I need to finish my work and deliver it.

Ant Klad commented on Feb 5, 2019

I managed to fix one of the problems (the Greek strings converted to FALSE) by changing line 47 ExcelExport.php from $text = Utility::format($row[$colKey], $colMetas[$colKey]); to $text = Utility::format(iconv ("CP1253", "UTF-8", $row[$colKey]), $colMetas[$colKey]); This works by changing the encoding of strings from CP1253 to UTF-8.

Is there a way to pass the encoding to ExcelExport.php with a parameter? Can you put this in your next version?

However I can't figure out why excel says that the format of the file is incorrect but after selecting to attempt to load the file it loads it successfully.

Ant Klad commented on Feb 5, 2019

OK. I found also the second problem. The reason for the corrupt file message was that I was exporting to .xls instead of .xlsx. When I use xlsx it works fine.

KoolReport commented on Feb 5, 2019

Great that you can find the solution for both challenging issues. It is good idea is to pass the encoding as parameters to ExcelExport, I will make suggestion to dev.team. Currently we have national holiday(Lunar New Year) until the end of this week, please forgive our support team for the late response as some of the issues like this, we need the dev.team to cooperate.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
bug
help needed

Excel