Focal Point
Formatting Selection Criteria in Report Header

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5831009932

August 02, 2007, 11:02 AM
KK
Formatting Selection Criteria in Report Header
I want to format the selection criteria in the report header. This selection criteria is being passed from a different application and I am using -set commands to display that conditionally in the report header.

-SET &ACCOUNTCLASSDESC = IF &IACCOUNTCLASSDESC EQ '' THEN 'Account Class: All' ELSE 'Account Class: ' ||&IACCOUNTCLASSDESC ;
-SET &METHODDESC = IF &IMETHODDESC EQ '' THEN 'Call Method: All' ELSE 'Call Method: ' ||&IMETHODDESC ;
-SET &SEGDESC = IF &IMARKETSEGMENTDESC EQ '' THEN 'Segment: All' ELSE 'Segment: ' || &IMARKETSEGMENTDESC;
-SET &REPORTCATEGORY = IF &IMEREPORTCATDESC EQ '' THEN 'Report Category: All' ELSE 'Report Category: ' ||&IMEREPORTCATDESC;

-* Report Header
ON TABLE SUBHEAD
"&ACCOUNTCLASSDESC<+0>&SEGDESC<+0>&METHODDESC<+0>&REPORTCATEGORY<+0> <+0> "

-- The final result if none selected

Account Class: All Segment: All Call Method: All Report Category: All

-- The final result if something is selected

Account Class: TEST Segment: TEST2 Call Method: TEST3 Report Category: TEST4

I would like to have the value in different color to differentiate it from the title.

so, the titles Account Class, Segment, Call Method, Report Category will be in black and the selected values will be in 'RED'.

Can we do this using -Set commands ? Does anyone have any sample code ?

Thank you,
KK


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
August 02, 2007, 11:14 AM
FrankDutch
Yes it can

you are using the grid, and each item of that grid can get a different fontcolor, bold setting etc, only the background is always the same per line (I just found out today)
So what you need to change is that the text "account class" is not in your amper field, but hard coded in the header and in a separate grid field.

In the code you have to say something like

TYPE=HEADING,LINE=3,OBJECT=TEXT,ITEM=1,SIZE=10,
COLOR=RGB(70 96 149),BACKCOLOR='WHITE',STYLE=BOLD,JUSTIFY=LEFT,WIDTH=4.625,$
TYPE=HEADING,LINE=3,OBJECT=TEXT,ITEM=2,SIZE=10,COLOR=RGB(70 96 149),
BACKCOLOR='WHITE',STYLE=BOLD,JUSTIFY=LEFT,WIDTH=1.125,$
TYPE=HEADING,LINE=3,OBJECT=TEXT,ITEM=3,SIZE=10,
COLOR=RGB(70 96 149),BACKCOLOR='WHITE',STYLE=BOLD,JUSTIFY=LEFT,WIDTH=1.125,$





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

August 02, 2007, 11:17 AM
ypatel
quote:
ON TABLE SUBHEAD
"&ACCOUNTCLASSDESC<+0>&SEGDESC<+0>&METHODDESC<+0>&REPORTCATEGORY<+0> <+0> "


- Yes we can do this. You can use
TYPE=SUBHEAD, BY=1, ITEM=1, COLOR=BLACK, $
TYPE=SUBHEAD, BY=1, ITEM=2, COLOR=READ, $ to apply color to an individual item in subhead..

Now in your example

&ACCOUNTCLASSDESC - is combination of label and value , and you want label colored black and value ('All') colored red
so here is what I think you may do

SET &ACCOUNTCLASSDESC = IF &IACCOUNTCLASSDESC EQ '' THEN 'All' ELSE &IACCOUNTCLASSDESC ;
-SET &METHODDESC = IF &IMETHODDESC EQ '' THEN 'All' ELSE &IMETHODDESC ;
-SET &SEGDESC = IF &IMARKETSEGMENTDESC EQ '' THEN 'All' ELSE &IMARKETSEGMENTDESC;
-SET &REPORTCATEGORY = IF &IMEREPORTCATDESC EQ '' THEN 'All' ELSE &IMEREPORTCATDESC;

-* Report Header
ON TABLE SUBHEAD
"Account Class:<+0>&ACCOUNTCLASSDESC<+0>
All Segment:<+0>&SEGDESC<+0>
Call Method:<+0>&METHODDESC<+0>
Report Category:<+0>&REPORTCATEGORY<+0> <+0> "

and then apply stylesheet above to color each item the way you want them colored.
item 1,3,5 & 7 are all labels and
item 2,4,6 & 8 are selected values..

Hope this helps !!


-Yogesh Patel
------------------------------------------------------------------------
PROD: WF 764 on Linux Apache tomcat v5.5
DEV: WF 768 on Linux
August 02, 2007, 11:36 AM
KK
Thank you Frank and Yogesh.

I will try that and get back to you.

KK


Test - Webfocus 7.6.7
Prod - Webfocus 7.6.7
Win2003
Sql Server 2000 and 2008
August 02, 2007, 01:30 PM
Tony A
The only addition I would make to that is to use RED instead of READ Wink.

Also check out the article by Susannah Jones entitled "What is Indian Red anyway" which gives a good overview of what colours that Excel can display (yes they are limited!!).

Another excellent site (again thanks to Susannah for putting me onto this one) is www.colorsontheweb.com

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 02, 2007, 08:37 PM
Tom Flynn
WHERE IS SUSANNAH???

I miss her wit, style, and knowledge. I hope she is OK!!!


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 03, 2007, 01:36 PM
cburtt
Why not simplify your task and convert one-row-of-three into 3-rows-of-one.
'Echo' the filter specs in a two column by 3 row diaplay. Put the filter's name in the first column and it's value in the 2nd column. Use <+n> spacing controls to left-justify both columns.
Takes up more vertical realestate but it's simpler to code and just as easy to read as colors.


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
August 03, 2007, 01:53 PM
Francis Mariani
I think Susannah's OK and she still has her sense of humour!

https://forums.informationbuilders.com/eve/forums/a/tpc/...551089932#5551089932


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server