[Case Opened] Conditionally Override a Style - Active Report.
When I run the following report...
TABLE FILE GGSALES
PRINT SEQ_NO
ST
DOLLARS
COMPUTE FLAG1/A20 = IF SEQ_NO EQ 1 OR 3 THEN 'GREEN' ELSE 'BLUE';
COMPUTE FLAG2/A20 = IF ST EQ 'MA' THEN 'RED' ELSE FLAG1;
-*
IF SEQ_NO LE 4
-*
ON TABLE PCHOLD FORMAT AHTML
ON TABLE SET HTMLCSS ON
ON TABLE SET LINES 30
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR = 'GREEN', WHEN = FLAG1 EQ 'GREEN',$
TYPE=DATA, BACKCOLOR = 'BLUE', WHEN = FLAG1 EQ 'BLUE',$
TYPE=DATA, COLUMN = ST, BACKCOLOR = 'RED', WHEN = FLAG2 EQ 'RED', $
ENDSTYLE
END
-EXIT
...I see alternating green and blue background colors.
The 'cell' with 'MA' does not have a 'red' background. Although I think I should be able to override the background color.
When I change the FORMAT to HTML, indeed I do see the 'red' background for 'MA'.
Any ideas, on what I am doing wrong, or what I can to to make AHTML behave as nicely as HTML?This message has been edited. Last edited by: David Briars,
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
June 22, 2015, 02:42 PM
MartinY
This does it
TABLE FILE GGSALES
PRINT SEQ_NO
ST
DOLLARS
COMPUTE FLAG1/A20 = IF SEQ_NO EQ 1 OR 3 THEN 'GREEN' ELSE 'BLUE';
COMPUTE FLAG2/A20 = IF ST EQ 'MA' THEN 'RED' ELSE FLAG1;
-*
-*IF SEQ_NO LE 4
-*
ON TABLE PCHOLD FORMAT AHTML
ON TABLE SET HTMLCSS ON
ON TABLE SET LINES 30
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE=DATA,
BACKCOLOR=( 'GREEN' 'BLUE' ),
$
TYPE=DATA, COLUMN = ST, BACKCOLOR = 'RED', WHEN = FLAG2 EQ 'RED', $
ENDSTYLE
END
With the benefit that every 'MA' is displayed in red background.
And if you invert the color, the color order assignation will be inverted to
BACKCOLOR=( 'BLUE' 'GREEM' ),
This message has been edited. Last edited by: MartinY,
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
June 22, 2015, 02:50 PM
David Briars
Thanks Martin!
In my case, I am really alternating colors with 'groups' of rows, not every other row, so I cannot use the 'alternating row' StyleSheet syntax.
Here is my scenario, showing the first two rows are green and then the next two rows are blue.
TABLE FILE GGSALES
PRINT SEQ_NO
ST
DOLLARS
COMPUTE FLAG1/A20 = IF SEQ_NO EQ 1 OR 2 THEN 'GREEN' ELSE 'BLUE';
COMPUTE FLAG2/A20 = IF ST EQ 'MA' THEN 'RED' ELSE FLAG1;
-*
IF SEQ_NO LE 4
-*
ON TABLE PCHOLD FORMAT AHTML
ON TABLE SET HTMLCSS ON
ON TABLE SET LINES 30
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLE *
TYPE=DATA, BACKCOLOR = 'GREEN', WHEN = FLAG1 EQ 'GREEN',$
TYPE=DATA, BACKCOLOR = 'BLUE', WHEN = FLAG1 EQ 'BLUE',$
TYPE=DATA, COLUMN = ST, BACKCOLOR = 'RED', WHEN = FLAG2 EQ 'RED', $
ENDSTYLE
END
-EXIT
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
June 22, 2015, 02:55 PM
MartinY
Huummm...
Able to change font color but not backcolor....
I know that there are several "issue/restrictions" with AHTML styling but can't find it.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
June 22, 2015, 03:12 PM
MartinY
Got it !
Have to code every column which is not the best, but it works