May 07, 2008, 04:40 AM
mhmHow to print in red negative numbers?
I'm work with WebFocus V7.6.3 / windows nt.
I'm spanish.
I want to know how can i print all numbers negative in my program in red ?
I can print in the format one by one , but is very hard.
I would like in only a sentence like this :
SET CENT-ZERO = ON
Is possible ?
Example :
ON TABLE SET STYLE *
....
TYPE=DATA,class=lnrojo, COLUMN=N5, WHEN=N5 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N6, WHEN=N6 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N7, WHEN=N7 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N8, WHEN=N8 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N9, WHEN=N9 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N10,WHEN=N10 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N11,WHEN=N11 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N12,WHEN=N12 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N13,WHEN=N13 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N14,WHEN=N14 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N15,WHEN=N15 LT 0, $
TYPE=DATA,class=lnrojo, COLUMN=N16,WHEN=N16 LT 0, $
....
ENDSTYLE
May 07, 2008, 05:51 AM
Danny-SRLOla MHM!
Todo bien?
As far as I know, there is no general command. But with a piece of Dialogue Manager you can overcome the problem. Notice the "-REPEAT" command. I put from 4 to 30 to show you that you do not have to code for exactly the number of columns.
-* File mhm1.fex
DEFINE FILE CAR
SALE1/I6=SALES - 2000;
SALE2/I6=SALES - 4000;
SALE3/I6=SALES - 6000;
SALE4/I6=SALES - 8000;
SALE5/I6=SALES - 10000;
SALE6/I6=SALES - 12000;
END
TABLE FILE CAR
PRINT
SALE1
SALE2
SALE3
SALE4
SALE5
SALE6
BY COUNTRY
BY CAR
BY BODYTYPE
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
-REPEAT #RED FOR &I FROM 4 TO 30;
TYPE=DATA, COLUMN=N&I, COLOR='RED', WHEN=N&I LT 0,$
-#RED
TYPE=TITLE,
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=TABFOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=HEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=FOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=SUBHEAD,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBFOOT,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBTOTAL,
BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
SIZE=9,
$
TYPE=ACROSSTITLE,
STYLE=BOLD,
$
TYPE=GRANDTOTAL,
BACKCOLOR=RGB(210 210 210),
STYLE=BOLD,
$
ENDSTYLE
END
Espero que sera un ayudo.
May 07, 2008, 06:22 PM
Jim ZuckerWhat you are describing is called "Conditional Styling?" WebFOCUS allows you to use multiple condition for different situations (e.g. numeric rangles).
Are you using WebFOCUS Developer Studio (WFDS)or one of the Web tools (Report Assistant or Power Painter) to create your report?
Developer Studio's Report Painter makes this EXTREMELY easy to use Conditional Styling.
The steps are as follows, at least for the English version of WFDS. I have not worked with the Spanish version, so I don't know what the screen text would be.:
1. Open the desired report in WFDS Power Painter.
2. Select the column (or columns) requiring the condition.
3. Right-Click on the column, and select the Option menu item. The first tab will be "Style"
4. The first window block is labeled "Active Object" Unless you want the column-title to be RED, select "Column Data" from the pull down.
5. Click on the "Edit Conditions..." button, and then create a new condition (e.g. COND0001) with the rule that a column "is less than" 0, then click on OK. The new condition will appear in the "Applying to Condition" text box.
6. Select this condition, then click on the "Select Font..." button.
7. Click on the "Color" button, and select your desired color (e.g. Red).
8. Click on the "Ok" buttons to get out.
9. Save and run your report and see if you get the desired results.
I hope this helps. Good luck