.
 News & Views
  The online information source for iSeries and mrc-Productivity Series users
.  January 2003  
Volume 3, Issue 1  
.
. . . . . . . . .
 

Hotline Question of the Month

by Margaret Jeronim
 

Question:

“I have a data retrieval application written in CGI that shows information about customer orders. I would like to display all the values that are greater than 1000 in a different color. How can I do that?”


Answer:

In order to display values in different colors based on specified condition, you will need to create a set of calculations. In following example Salesman's 'Total Commission' is displayed in color red if that commission is greater than 1000.

In order to change font color to red you need to add this tag in your HTML <font color=red>. To make sure that this color is displayed only when the condition is true (total commission greater than 1000) alphanumeric calculations 'font', 'color' and 'red' are created. Then those calculations are concatenated into an 'HTML tag ' calculation that will give <font color=red> HTML tag.

That calculation is then used as a result in the conditional calculation 'Commission greater than 1000' that will be executed only if 'Total commission' is greater than 1000. See Figure 1 - Calculated fields - to see the logic.

Figure 1 — Calculated fields. (Click to enlarge)


In option 5 — Preformat of your retrieval to make sure to specify the calculation 'Commission greater than 1000' as Display type — you will not need to display 'font', 'color' 'read' and 'HTML tag' calculations. See Figure 2 — Preformat — for calculations, sizes, and display types. Compile your application.

Figure 2 — Preformat (Click to enlarge)


Your generated application will look like the one in Figure 3 — Sales Performance by Name (note: number of records to display was changed to 10 instead of the default 5). You can see that the last field displayed is 'Commission greater than 1000".

Figure 3 — Sales Performance by Name (Click to enlarge)


You will need to modify QHTMLSRC for your retrieval application by following these two easy steps:
1. The first step is to comment out these two lines of code:

  • 'Commission greater than 1000' from table headings (<TH> tag)
  • field name corresponding to 'Commission greater than 1000' field
  • 2. The second step is to include 'Commission greater than 1000' before field that corresponds to 'Total commission' field. See Figure 4 — QHTMLSRC changes for visual representation of steps.

    Figure 4 — QHTMLSRC for changes.(Click to enlarge)


    Save your changes, refresh your browser and you will have values displayed in red based on condition. See figure 5 - Sales Performance by Name (with 'Total Commission' in color red if greater than 1000)

    Figure 5 - Sales Performance by Name (with 'Total Commission' in color red if greater than 1000) (Click to enlarge)




    Have a hotline question of your own? Send an e-mail to support@mrc-productivity.com and let our product specialists help you!



    Take Our Poll

    Which software is more secure?

    Yahoo
    Google
    All the Web
    Lycos
    AltaVista
    Other

    View Results
    View Poll Archive

    .
    .
    .
    .
    . Quick Links...

    Visit mrc's Web site

    See a live demo

    Get more information

    View Latest Newsletter

    Last Month's Newsletter

    .
    .
    .
    .
    . Contact mrc...

    U.S. Offices
    mrc@mrc-productivity.com

    voice: 630-916-0662

    www.mrc-productivity.com



    U.K. Offices
    michaels, ross & cole (UK) ltd

    voice (UK): +44 (0)20 8282 1600

    mail@mrcuk.com


    .
     mrc publishes this newsletter on a monthly basis. Subscription is free of charge. Please send any questions or comments about this newsletter to news@mrc-productivity.com. This newsletter is edited by Heather Gately.

    To unsubscribe, please just reply to this e-mail with Unsubscribe in the subject line.
    View our privacy promise.

    .