This topic is locked
[SOLVED]

 Ampersand displays as & in CSV export

7/17/2009 10:32:39 AM
PHPRunner General questions
J
John Fiore - DFS author

Hello,

PHPRunner is great, and the export feature allows for easy data transportation. But I have run into a problem that I have not found a solution yet...
In CSV exports, ampersands displays as "&" when viewed in a text editor like UltraEdit. For example, in a name field, "John & Jane Doe" in the database and PHPRunner 4.2 (build 379) appears as "John & Jane Doe". (All other exports -- Excel, Word, XML and PDF -- display the ampersand correctly.) Would you recommend I add code to the ExportOnLoad event? Or is there a better solution?
Thanks in advance!

J
Jane 7/20/2009

Hi,
to fix it open generated ..._export.php file, find this line:

$outstr.='"'.htmlspecialchars(GetData($row,"FieldName",$format)).'"';



and replace it with this one:

$outstr.='"'.htmlspecialchars_decode(GetData($row,"FieldName",$format)).'"';

J
John Fiore - DFS author 8/10/2009

Hi Jane,

Thanks for the reply. I was able to successfully fix the generated export.php file and the issue no longer occurred. But recently, I made a change using PHPRunner (version 4.2 build 379) and now the re-generated export.php no longer has the fix I put in. Is there a way I can make the fix in PHP Runner or do I need to upgrade or do something else?

---John---

Hi,

to fix it open generated ..._export.php file, find this line:
and replace it with this one:

J
Jane 8/11/2009

John,
you can edit PHPRunner4.2/source/import.php file. In this case you don't need to apply these changes after rebuilding.