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.
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
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?
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, 2010
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, 2010
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
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.
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
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, 2007