This topic is locked

Custom Code + CSV Export

6/10/2008 3:04:48 PM
PHPRunner General questions
S
spoilar author

I am using a custom code in one of my fields. It works fine except for when it is exported as a CSV file. The output basically includes the code.
Example is cited below.

I am using v4.2 build 379.
Custom Code:

$str = "<font color=";

if (($value < $data['QuantityShipped']) && ($value <> 0)){

$str.="red";

}

elseif ($value == 0){

$str.="green";

}

$str.=">".$value."</font>";

$value=$str;


CSV output field:

&lt;font color=red&gt;5&lt;/font&gt;
J
Jane 6/11/2008

Hi,
I see what you're saying.

You can do the following:

  1. edit SQL query on the Edit SQL query tab. Here is a sample:
    select field1,

    field1 as field1_export

    ...

    from TableName



2. check off field1 on the list page, field1_export on the export page on the Choose fields tab.

S
spoilar author 6/11/2008

Wow! So simple, yet so brilliant.
Worked perfectly. Thank you so much.
I fixed the problem before, but it was a couple years ago and I forgot how I did it. But I remember I manipulated the _export.php page somehow.