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.
I need some help to implement a LOOP to show few COUMPOUND PDF reports. The number of COMPONENTs will be dynamic.
Can anyone help me?
-* File: IBFS:/WebFOCUS 8X DEV/WFC/Repository/vesir218/std_reports/dev/Procedure1.fex Created by WebFOCUS AppStudio
SET ASNAME=ON
SET CENT-ZERO=ON
SET CDN=ON
-SET &ECHO=ALL;
-SET &CTR = 0;
-SET &COUNTRY='X';
TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS H1 FORMAT ALPHA
END
-SET &HOWMANY = &LINES ;
-REPEAT ENDLOOP FOR &CTR FROM 1 TO &HOWMANY
-READFILE H1
-SET &PAIS=LTRIM(RTRIM(&COUNTRY));
-RUN
-*
-*-* START PDF COMPOUND SECTION
SET HTMLARCHIVE=ON
COMPOUND LAYOUT PCHOLD FORMAT PDF AS LOOP_COMPOUND
UNITS=PTS, $
SECTION=section1, LAYOUT=ON, METADATA='5^5^5^5^4', MERGE=OFF, ORIENTATION=LANDSCAPE, PAGESIZE=LETTER, SHOW_GLOBALFILTER=OFF, $
PAGELAYOUT=ALL, $
PAGELAYOUT=&CTR, NAME='&CTR', text='&CTR', TOC-LEVEL=1, TOPMARGIN=1, ORIENTATION=LANDSCAPE, $
COMPONENT='&PAIS', TEXT='&PAIS', POSITION=(+1 +80), DIMENSION=(* *), $
END
SET COMPONENT=&PAIS
-RUN
TABLE FILE CAR
SUM
SALES/D10
BY MODEL
IF COUNTRY EQ '&PAIS'
ON TABLE SUBHEAD
"SALES FROM &PAIS &CTR"
""
ON TABLE COLUMN-TOTAL
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT,
SIZE=4,
$
ENDSTYLE
END
-ENDLOOP
-ENDREPEAT
-EXIT
This message has been edited. Last edited by: Kathleen Butler,
WebFOCUS 8.1.05 / APP Studio
Posts: 272 | Location: Brazil | Registered: October 31, 2006
The thing you have to remember about the newer compound syntax is that it basically consists of two sections which have to be presented in the correct order.
The first is the "compound layout" and will consist of the page layout with all the components in the order that they will be given in the second section.
The second section is the "components" and will consist of all the components in the order in which they appear in the layout section. The first line will be a declaration of the component (SET COMPONENT=...).
So if you comprehend this then one way you could achieve this is by writing out the two sections into separate files and then -INCLUDE filename.
Should be straight forward to code.
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, 2004
So basically, using your code as a base - e.g. not syntax checked etc.
You would get something like the following. Just refine the output shown by the CMD TYPE statements until you know that you've not got an unending loop process etc. and that the compound syntax is just right for your needs. Then comment out the CMD TYPE statements and uncomment the -INCLUDE statements.
T
FILEDEF LAYOUT DISK LAYOUT.FEX
FILEDEF CMPNTS DISK COMPONENTS.FEX
-RUN
-WRITE LAYOUT SET HTMLARCHIVE=ON
-WRITE LAYOUT COMPOUND LAYOUT PCHOLD FORMAT PDF AS LOOP_COMPOUND
-WRITE LAYOUT UNITS=PTS, $
-WRITE LAYOUT SECTION=section1, LAYOUT=ON, METADATA='5^5^5^5^4', MERGE=OFF, ORIENTATION=LANDSCAPE, PAGESIZE=LETTER, SHOW_GLOBALFILTER=OFF, $
-WRITE LAYOUT
-WRITE LAYOUT PAGELAYOUT=ALL, $
-WRITE LAYOUT
-WRITE LAYOUT PAGELAYOUT=1, NAME='Layout1', text='Layout1', TOC-LEVEL=1, TOPMARGIN=1, ORIENTATION=LANDSCAPE, $
-WRITE LAYOUT
TABLE FILE CAR
BY COUNTRY
ON TABLE HOLD AS TEMPHLD1
END
-RUN
FILEDEF LAYOUT DISK LAYOUT.FEX (APPEND
-RUN
-READFILE TEMPHLD1
-REPEAT :Loop WHILE &IORETURN EQ 0;
-SET &Country = TRUNCATE(&COUNTRY);
-WRITE LAYOUT COMPONENT='&Country', TEXT='&Country', POSITION=(+1 +80), DIMENSION=(* *), $
-WRITE CMPNTS SET COMPONENT=&Country.QUOTEDSTRING
-WRITE CMPNTS -RUN
-WRITE CMPNTS TABLE FILE CAR
-WRITE CMPNTS SUM SALES/D10
-WRITE CMPNTS BY MODEL
-WRITE CMPNTS IF COUNTRY EQ '&Country'
-WRITE CMPNTS ON TABLE SUBHEAD
-WRITE CMPNTS "SALES FROM &Country"
-WRITE CMPNTS ""
-WRITE CMPNTS ON TABLE COLUMN-TOTAL
-WRITE CMPNTS ON TABLE SET PAGE-NUM NOLEAD
-WRITE CMPNTS ON TABLE PCHOLD FORMAT PDF
-WRITE CMPNTS ON TABLE SET STYLE *
-WRITE CMPNTS TYPE=REPORT, SIZE=4, $
-WRITE CMPNTS ENDSTYLE
-WRITE CMPNTS END
-WRITE CMPNTS -RUN
-READFILE TEMPHLD1
-:Loop
-WRITE LAYOUT END
CMD TYPE LAYOUT.FEX
CMD TYPE COMPONENTS.FEX
-*-INCLUDE LAYOUT.FEX
-*-INCLUDE COMPONENTS.FEX
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, 2004