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     Not exactly a subfoot , not exactly a subhead

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Not exactly a subfoot , not exactly a subhead
 Login/Join
 
Silver Member
posted
Hello folks,
At a first glance the problem may not seem so difficult but I don't have an idea how this could be achieved ( if it is possible )
I have I table and I want to achieve the following : if a given key value is eqaul to 1 I want to print the columns otherwise a label.
e.g. lets have the following table:

TABLE1

COL1 COL2
---- ----

1 A
1 B
2 C
3 D
1 E
2 F
1 G
1 H

And I want the report in the following form:


REP

COL1 COL2
---- ----

_some_label_
_some_label_
2 C
3 D
_some_label_
2 F
_some_label_
_some_label_

Using a subfood or a subhead is not doing the job. ( subhead always prints at the beginning of the table and subfoot - at the end )
Thanks in advance !

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


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Expert
posted Hide Post
Compute a new field in your report to determine the value of COL1 and assign a value accordingly. If the label is alpha and COL1 is numeric then you will have to convert COL1 to alpha before stroing it in your new field. Finally sort COL2 NOPRINT to get it in the order that you imply.

And please update your signature as per link on front page

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
Silver Member
posted Hide Post
Sorry , but I was not clear enough - that label is not in any column - it is a separate row as a subhead or a subfoot is and can be separately aligned.


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Virtuoso
posted Hide Post
Take a look at the code below. It comes close, I think.
FILEDEF MFD DISK mfd1.mas
-RUN
-WRITE MFD FILENAME=MFD1, SUFFIX=FIX, $
-WRITE MFD SEGNAME=MFD1, $
-WRITE MFD FIELDNAME=COL1, FORMAT=I4, ACTUAL=A4 , $
-WRITE MFD FIELDNAME=COL2, FORMAT=A4, ACTUAL=A4 , $

FILEDEF MFD1 DISK mfd1.ftm
-RUN
-WRITE MFD1 1   A
-WRITE MFD1 1   B
-WRITE MFD1 2   C
-WRITE MFD1 3   D
-WRITE MFD1 1   E
-WRITE MFD1 2   F
-WRITE MFD1 1   G
-WRITE MFD1 1   H

DEFINE FILE MFD1
 LINENUM/I5 = LINENUM + 1 ;
 SHOW1/A15  = IF COL1 EQ 1 THEN '_some_label_' ELSE FTOA(COL1,'(D4)',SHOW1);
 SHOW2/A4   = IF COL1 EQ 1 THEN ' ' ELSE COL2;
END

TABLE FILE MFD1
PRINT
     SHOW1 NOPRINT
     SHOW2 NOPRINT
BY LINENUM NOPRINT 

ON LINENUM SUBHEAD
"<SHOW1>"
WHEN SHOW1 EQ '_some_label_';
ON LINENUM SUBHEAD
"<SHOW1><SHOW2 <+0> "
WHEN SHOW1 NE '_some_label_';
HEADING
" <+0> "
ON TABLE NOTOTAL
ON TABLE SET PAGE NOPAGE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=N2 EQ '_some_label_',
$
     DEFMACRO=COND0002,
     MACTYPE=RULE,
     WHEN=N2 NE '_some_label_',
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
TYPE=SUBHEAD,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=1,
     JUSTIFY=right,
     WIDTH=.700,
$
TYPE=SUBHEAD,
     BY=1,
     LINE=1,
     OBJECT=FIELD,
     ITEM=2,
     JUSTIFY=right,
     WIDTH=.500,
$
TYPE=SUBHEAD,
     BY=1,
     FONT='VERDANA',
     COLOR='YELLOW',
     BACKCOLOR=RGB(51 153 102),
     JUSTIFY=center,
     MACRO=COND0001,
$
TYPE=SUBHEAD,
     BY=1,
     FONT='VERDANA',
     COLOR='WHITE',
     BACKCOLOR='PURPLE',
     JUSTIFY=right,
     MACRO=COND0002,
$
ENDSTYLE
END

Hope this helps you along ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
GamP , thanks a lot but the subhead is printed always at the beginning of the report. So I have not tried it but if I simply put a subhead and use 'when col1 EQ 1' after the subhead I am not sure whether it will print a subhead at the beginning whenever there is 1 or not as the first value in col1. I will try it - thanks again Smiler


WF 7.6.5 / OS: XP / FOCUS
 
Posts: 42 | Registered: September 01, 2008Report This Post
Expert
posted Hide Post
Martin,

I haven't looked at your request in great detail but at first glance it looks like the MacGyver Technique might help you out.

Here is a link for you:

MacGyver Technique

You can also search for 'macgyver' on this forum and you will get lots of hits.

I don't know what your skill level is with the product but once you understand what the technique does for you, you can use it to solve a multitude of problems.

I will try to revisit this in a bit as I have to do something for one of my users now.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
I looked at GamP's post again and if you take out the subhead stuff, I think it does what you want.

FILEDEF MFD DISK mfd1.mas
-RUN
-WRITE MFD FILENAME=MFD1, SUFFIX=FIX, $
-WRITE MFD SEGNAME=MFD1, $
-WRITE MFD FIELDNAME=COL1, FORMAT=I4, ACTUAL=A4 , $
-WRITE MFD FIELDNAME=COL2, FORMAT=A4, ACTUAL=A4 , $

FILEDEF MFD1 DISK mfd1.ftm
-RUN
-WRITE MFD1 1   A
-WRITE MFD1 1   B
-WRITE MFD1 2   C
-WRITE MFD1 3   D
-WRITE MFD1 1   E
-WRITE MFD1 2   F
-WRITE MFD1 1   G
-WRITE MFD1 1   H

DEFINE FILE MFD1
 LINENUM/I5 = LINENUM + 1 ;
 SHOW1/A15  = IF COL1 EQ 1 THEN '_some_label_' ELSE FTOA(COL1,'(D4)',SHOW1);
 SHOW2/A4   = IF COL1 EQ 1 THEN ' ' ELSE COL2;
END

TABLE FILE MFD1
PRINT
     SHOW1  AS COL1
     SHOW2  AS COL2
BY LINENUM NOPRINT 

-*ON LINENUM SUBHEAD
-*"<SHOW1>"
-*WHEN SHOW1 EQ '_some_label_';
-*ON LINENUM SUBHEAD
-*"<SHOW1><SHOW2 <+0> "
-*WHEN SHOW1 NE '_some_label_';
HEADING
" <+0> "
ON TABLE NOTOTAL
ON TABLE SET PAGE NOPAGE
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=N2 EQ '_some_label_',
$
     DEFMACRO=COND0002,
     MACTYPE=RULE,
     WHEN=N2 NE '_some_label_',
$
TYPE=REPORT,
     GRID=OFF,
     FONT='TIMES NEW ROMAN',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
$
ENDSTYLE
END


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report 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     Not exactly a subfoot , not exactly a subhead

Copyright © 1996-2020 Information Builders