Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change text color from a concatenated string 1

Status
Not open for further replies.

AnthonyMJ

Programmer
Feb 24, 2008
41
US
I have succeeded in concatenating a list of products for the same customer. Now I would like to change the color of those products where the sale date is greater than a specified date.

Here's a mockup data.

Code:
Customer  Product   Sale Date
--------+---------+-----------
   1        A        01/01
   1        B        01/15
   1        C        01/16
   2        X        01/05
   2        Y        01/11
   2        Z        01/15

Result Set
Code:
Customer  Product
--------+---------
   1      A, [COLOR=red]B[/color], [COLOR=red]C[/color]
   2      X, Y, [COLOR=red]Z[/color]

From the result set above, I need to change the product's color to red when it's sale date > 01/13 therefore products B, C and Z should be colored red as shown above.

Any help is appreciated.

XIR2 on Unix Solaris
Informatica 7.1.3
CRXIR2, Oracle 9i/10g
 
You should change the formula you use to concatenate the products to:

whileprintingrecords;
stringvar prod;
if {table.saledate} > {?Date} then
prod := prod + "<font color = red>"+{table.product}+"</font color>"+", " else
prod := prod + {table.product}+", ";

Then format your display formula which looks like:
whileprintingrecords;
stringvar prod;
left(prod,len(prod)-2)

...by going to format field->text interpretation->HTML text.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top