Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Conditional Column Styling

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Conditional Column Styling
 Login/Join
 
Gold member
posted
Hi!
In my report, i have to conditionally highlight the columns based on the condition, if the field NIGHT_IND is 'Y'.
In our report we have IN and OUT events for 7days.And i want to put the condition for every OUT event.
We already have a field called 'NIGHT_IND', with value 'Y' or 'N', to identify, whether that field needs to be highlighted or not.
I have tried to put the conditional for one column and it worked fine.But, when i am trying this condition for other columns, it is getting highlighted but in wrong place. It is getting highlighted in one position above or below from the actual position.
Actually it is getting highlighted just next position of OUT Event to the previous column.

Please Advice..

Thanks
Arpita

This message has been edited. Last edited by: Arpita,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Expert
posted Hide Post
quote:
TYPE=DATA,
-* removing the column notation should achieve what you need
-* COLUMN=N10,
FONT='ARIAL',
SIZE=9,
STYLE=NORMAL,
BACKCOLOR=RGB(220 220 255), WHEN=NIGHT_IND EQ 'Y',
$

Try the above change

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Hi Tony,
Thanks for your reply.
I tried your advice, but it did'nt work.
It is Highlighting the whole row with the first day OUT event.
But, i want to highlight the specific value for all the 7 days OUT Event,which satisfy the condition of the OUT Event in the OUT Event Columns.
Please advice.

Thanks
Arpita


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Expert
posted Hide Post
Try using a sample database such as EMPDATA to explain your report and the required styling.

For instance, we do not know if you are using ACROSS etc.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Instead of COLUMN=N10 (which is a NOPRINT column BTW) you probably need ACROSSCOLUMN=N2 (which is the same NOPRINT column, but across).


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
quote:
Across columns

Precisely why you need to give as much information in your post as possible. As Wep5622 says, you need to ensure you use the correct syntax for the styling element that you need.

SET NODATA = ''
DEFINE FILE EMPDATA
 MONTH/Mt    = HIREDATE
END

TABLE FILE EMPDATA
  SUM HIREDATE
      CNT.HIREDATE AS 'Count'
   BY MONTH
ACROSS DEPT
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  GRID=OFF, SIZE=9, $
  TYPE=DATA, ACROSSCOLUMN=N1, BACKCOLOR=GREEN, WHEN=CNT.HIREDATE GT 1, $
ENDSTYLE
END

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
Hi Wep,
Thanks a lot for your reply.
I tried your suggestion to use ACROSSCOLUMN= N2,
It worked fine for 3 columns(tues,wed n thrus),
But, for rest of the columns(sun,mon n fri),it is not working.
Please advice...
Thanks
Arpita


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Virtuoso
posted Hide Post
I just noticed you're using NIGHT_IND in your WHEN-expression. In my experience that doesn't work for ACROSS columns, but a column number does. No idea what's the reason behind that...

I think it should be:
TYPE=DATA,
ACROSSCOLUMN=N2,
...
WHEN=N15 EQ 'Y',
$


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
The notation given should work just fine -

This code (with some underlying data) gives the report that follows -

DEFINE FILE CLOCKING
  CLKD_MINS/D12.2 = HDIFF(OUT_DATETIME, IN_DATETIME, 'MINUTE', 'D12.2');
  CLKD_HRS/D12.2  = CLKD_MINS / 60;
  NIGHT_IND/A1    = IF HDATE(OUT_DATETIME, 'YYMD') GT  HDATE(IN_DATETIME, 'YYMD') THEN 'Y' ELSE 'N';
  DATE_DMYY/DMYY  = HDATE(IN_DATETIME, 'DMYY');
  DAYNUMBER/A2    = HNAME(IN_DATETIME, 'weekday', 'A2');
  WKNUMBER/A2     = HNAME(IN_DATETIME, 'week', 'A2');
  DAYOFWEEK/A12   = LCWORD(12, DOWKL(DATECVT(HDATE(IN_DATETIME, 'YYMD'), 'YYMD', 'I8YYMD'), 'A12'), 'A12');
  START_TM/A8     = HNAME(IN_DATETIM, 'HOUR', 'A2') ||':'||HNAME(IN_DATETIM, 'MINUTE', 'A2') ||':'||HNAME(IN_DATETIM, 'SECOND', 'A2');
  FINISH_TM/A8    = HNAME(OUT_DATETIM, 'HOUR', 'A2')||':'||HNAME(OUT_DATETIM, 'MINUTE', 'A2')||':'||HNAME(OUT_DATETIM, 'SECOND', 'A2');
END

TABLE FILE CLOCKING
   SUM START_TM      AS 'In'
       FINISH_TM     AS 'Out'
       CLKD_HRS      AS 'Tot'
       NIGHT_IND     NOPRINT
    BY CONTRACTOR_ID NOPRINT
    BY WKNUMBER      AS 'Week No.'
    BY CONTRACTOR_ID AS 'SAP No.'
    BY CONTRACTOR_NM AS 'Name'
ACROSS DAYNUMBER     NOPRINT
ACROSS DAYOFWEEK     AS ''
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  GRID=OFF, SIZE=9, FONT=ARIAL, $
  TYPE=HEADING, HEADALIGN=BODY, $
  TYPE=DATA, ACROSSCOLUMN=N2, WHEN=NIGHT_IND EQ 'Y', BACKCOLOR=RGB(200 200 255), BORDER-COLOR=RGB(220 220 255), $
ENDSTYLE
END


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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
And the output


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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
That's just a matter of applying the same styling to another column as well, isn't it?

I haven't tried, but you could probably define a macro with that condition and the required styling and apply that to those columns - that would save you some style-duplication.

Something like:
DEFMACRO=DEF001,
    BACKCOLOR=RGB(200 200 255),
    BORDER-COLOR=RGB(220 220 255),
    WHEN=NIGHT_IND EQ 'Y',
$
TYPE=DATA, ACROSSCOLUMN=N1, MACRO=DEFMACRO,$
TYPE=DATA, ACROSSCOLUMN=N2, MACRO=DEFMACRO,$


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
Hi Wep,
Thanks for your reply.
I have tried applying the same styling to another column as you have suggested before only.
It worked fine for 3 columns(wed,thrus n fri),
But, for rest of the columns(mon and tues),it is not working.
I know it is strange, but i don't know what to do.

Please advice...

Thanks
Arpita


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 43 | Registered: October 04, 2010Report This Post
Virtuoso
posted Hide Post
Does it work if you use N15 (if I counted correctly!) instead of NIGHT_IND in the macro definition?

That would confirm my earlier suspicions.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
According to the table file you posted upthread column N12 is START_TIME.

If columns don't get highlighted when they should, then either

  • the column you're styling (TYPE=DATA, ACROSSCOLUMN=N1), or
  • the column that you're using in your condition (WHEN=), or
  • the value you're comparing against
is wrong.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
quote:
It worked fine for 3 columns(wed,thrus n fri),
But, for rest of the columns(mon and tues),it is not working.

If it works for three columns using the syntax suggested, but not two others then I would suspect that either the data (upon which you are performing your test) is suspect or that you're not telling us the entire story.

The styling would be applied globally so if it works for some columns but not others then I would really be very suspicious.

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Conditional Column Styling

Copyright © 1996-2020 Information Builders