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     [SOLVED] Last two rows of data to be bold

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Last two rows of data to be bold
 Login/Join
 
Silver Member
posted
Hi all,

How do I identify the last two rows of data in my style sheet? I need to make the last two rows bold. Is this possible?

Thanks in advance,
B

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


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Platinum Member
posted Hide Post
Hope this will help u,

TABLE FILE CAR
PRINT CAR
COUNTRY
ON TABLE HOLD
END

-SET &LAST_ROW = &LINES;
-SET &PENUL_ROW = &LAST_ROW - 1;

TABLE FILE CAR
PRINT CAR
COUNTRY
COMPUTE RANK/I2 = RANK + 1; NOPRINT
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE = DATA, STYLE=BOLD, WHEN = RANK EQ &PENUL_ROW,$
TYPE = DATA, STYLE=BOLD, WHEN = RANK EQ &LAST_ROW,$
END

-Hari


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
 
Posts: 165 | Registered: September 29, 2008Report This Post
Virtuoso
posted Hide Post
What is so particular about those 2 rows of data when compared to the rest of the data in your report? Are they sub-totals or totals? or .. is there "something" in there that would allow to clearly differentiate them from other rows in the same data set?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Silver Member
posted Hide Post
They are the totals for the particular region the user selected and the total for the company. I had to create 3 hold files and then used MORE to join all three hold files together. Now I need to format the report so the last lines are bold.


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by atturhari:
Hope this will help u,

TABLE FILE CAR
PRINT CAR
COUNTRY
ON TABLE HOLD
END

-SET &LAST_ROW = &LINES;
-SET &PENUL_ROW = &LAST_ROW - 1;

TABLE FILE CAR
PRINT CAR
COUNTRY
COMPUTE RANK/I2 = RANK + 1; NOPRINT
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
TYPE = DATA, STYLE=BOLD, WHEN = RANK EQ &PENUL_ROW,$
TYPE = DATA, STYLE=BOLD, WHEN = RANK EQ &LAST_ROW,$
END

-Hari


Thanks Hari,

I'm not seeing the formatting change. What is RANK supposed to represent? The row number?


WebFOCUS 7.7
Windows
All Output (Excel, HTML, PDF)
 
Posts: 31 | Location: Maryland, USA | Registered: April 30, 2010Report This Post
Virtuoso
posted Hide Post
What's in each HOLD file? Do you have something like this?

HOLD1: Detailed records
HOLD2: Total for the Region
HOLD3: Total for the Company

If so, you can define a special field to keep some sort of record type indicator which can later be used in your style sheet.

Something like:
FILEDEF HOLDFINAL DISK holdfinal.ftm (APPEND
-RUN
SET HOLDLIST=PRINTONLY
SET ASNAMES=ON
-*
-* 1. Send detail records to resulting HOLD file
DEFINE FILE HOLD1
REC_TYPE/A10 = '1DETAIL';
END
TABLE FILE HOLD1
SUM FIELD1
    FIELD2
    FIELD3
    ...
BY REC_TYPE   <-- Record type indicator
BY ...
ON TABLE HOLD AS HOLDFINAL
END
-*
-* 2. Add region total to resulting HOLD file
DEFINE FILE HOLD2
REC_TYPE/A10 = '2TLREGION';
END
TABLE FILE HOLD2
SUM FIELD1
    FIELD2
    FIELD3
    ...
BY REC_TYPE
BY ...
ON TABLE HOLD AS HOLDFINAL
END
-*
-* 3. Add company total to resulting HOLD file
DEFINE FILE HOLD3
REC_TYPE/A10 = '2TLCOMPANY';
END
TABLE FILE HOLD3
SUM FIELD1
    FIELD2
    FIELD3
    ...
BY REC_TYPE
BY BYFIELD1
BY BYFIELD2
BY ...
ON TABLE HOLD AS HOLDFINAL
END
-RUN


Now you have a file (HOLDFINAL) with all of the information you need. You can then create a report and style it according to REC_TYPE:

TABLE FILE HOLDFINAL
PRINT FIELD1
      FIELD2
      FIELD3
      ...
BY REC_TYPE NOPRINT
BY BYFIELD1
BY BYFIELD2
BY ...
ON TABLE SET STYLE *
...
TYPE=DATA, STYLE=+BOLD, WHEN=REC_TYPE NE '1DETAIL', $
....
ENDSTYLE
END



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Virtuoso
posted Hide Post
You don't specify how HOLD1, HOLD2 and HOLD3 were created in the first place but if you can control it, it would be preferable to create the REC_TYPE field *while* creating those HOLD files. If you do that, you can then use MORE (instead of the technique I showed above) making sure that REC_TYPE is included in the resulting HOLD file.

The style definition would remain the same.

Hope that helps!



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
bflemi3, Attuhari's example works for me - the last two lines are in bold . Just remove the NOPRINT from the RANK computation and you'll see that it is indeed a row number.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
If those lines are just total lines, you should use
BY fieldname
ON fieldname SUB-TOTAL

SUBTOTAL is one of the componenets that can be styled:
TYPE=SUBTOTAL, BY=fieldname, STYLE=BOLD,$


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report 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     [SOLVED] Last two rows of data to be bold

Copyright © 1996-2020 Information Builders