3.2.0

Want to color/shade the specific cell while exporting the csv file via PHP

Hi!
I m exporting a csv via php. i need to shade specific cells on some conditions any idea how to do that?

a piece of code is here...
while(!$rsLength->EOF && $rsLength!=null)
{
$rsPrice = $objProduct->GetProdPrice($rsWidth->fields['width_ID'],$rsLength->fields['length_ID'],$ProdID);
if(strlen($rsPrice->fields['price'])==0)
$new_contents .= "---,";
else
{
if($rsPrice->fields['isSplice']==1)
{?>
<font color="red"> <?$new_contents .= "*$ ".$rsPrice->fields['price'].",";
?></font><?
}
else if($rsPrice->fields['isSplice']==0)
$new_contents .= "$ ".$rsPrice->fields['price'].",";
}
$rsLength->MoveNext();
}
help needed
March 26,
I asked a similar question about 2 months or so ago.

The solution is quite simple. You can do it in JavaScript with some calls to the AW functions. E.g. -
obj.defineCellProperty("color")
        obj.setCellColor(function(col, row){
                return this.getCellData(4, row).match("fail") ? "red" : "black"})
        obj.getCellTemplate(4).setStyle("color", function(){
                return this.getCellProperty("color")})

In this example, I set the colour of the text in the fifth column to be either red or black depending on whether the text matches the string "fail" or not.
Anthony
March 26,

This topic is archived.

See also:


Back to support forum