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 am trying to create a compound report on pdf (all on one page, if possible) by calling one/more proc inside a loop from the first procedure. But Its doesn�t display the report. What am I missing or doing incorrect? Also how can I pass the value of country to test_02.fex from test_01.fex inside the loop. Thanks for your time.
-* File test_01.fex TABLE FILE CAR BY COUNTRY ON TABLE HOLD AS CTRYHLD FORMAT ALPHA END -RUN -*-------------------------------------------------------- -* Read the list of countries: -*-------------------------------------------------------- -SET &CTRYLIST = ''; -SET &CNTRY_COUNT = &LINES; -REPEAT :CTRYLOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -READ CTRYHLD &TMPVAR.A10 NOCLOSE -SET &CTRYLIST.&CNT = &TMPVAR; -:CTRYLOOP END -*--------------------------------------------------------- -* Execute another procedure passing the value of country -*--------------------------------------------------------- SET PAGE-NUM=NOPAGE SET PRINTPLUS=ON SET COMPOUND=OPEN
-REPEAT SALES_LOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -TYPE &CTRYLIST.&CNT -* How can I pass the value of country to test_02.fex? EX test_02.fex -SALES_LOOP
SET COMPOUND=CLOSE END
-* File test_02.fex -DEFAULT &COUNTRY='ENGLAND'; TABLE FILE CAR SUM SALES DEALER_COST BY COUNTRY WHERE (COUNTRY EQ '&COUNTRY') ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT PDF NOBREAK ON TABLE SET STYLE * UNITS=IN, PAGESIZE='A4', SQUEEZE=OFF, ORIENTATION=LANDSCAPE, $ TYPE=REPORT, GRID=ON, $ END
-REPEAT SALES_LOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -TYPE &CTRYLIST.&CNT -* How can I pass the value of country to test_02.fex? EX test_02 COUNTRY='&CNTRYLIST.&CNT' -SALES_LOOP
As you suggested I have changed the first proc as -*EX test_02.fex EX test_02 COUNTRY='&CTRYLIST.&CNT'
But it displays an html page with the following. 0 NUMBER OF RECORDS IN TABLE= 5 LINES= 5 ENGLAND FRANCE ITALY JAPAN W GERMANY 0 NUMBER OF RECORDS IN TABLE= 4 LINES= 1 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 0 NUMBER OF RECORDS IN TABLE= 4 LINES= 1 0 NUMBER OF RECORDS IN TABLE= 2 LINES= 1 0 NUMBER OF RECORDS IN TABLE= 7 LINES= 1
I apologize for disputing you, JG, but that statement is not true. However, the SET COMPOUND=CLOSE does have to come prior to the final TABLE FILE, not after. Your loop needs to be smart enough to know that you are about to execute the report program for the last time. Or you need to make that last execution outside the loop.
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005
I have modified the procs as follows. But I am still not getting the pdf report? What am I missing?
-* File test_01.fex SET TRACEON = ALL SET TRACEUSER = ON
TABLE FILE CAR BY COUNTRY ON TABLE HOLD AS CTRYHLD FORMAT ALPHA END -RUN -*-------------------------------------------------------- -* Read the list of countries: -*-------------------------------------------------------- -SET &CTRYLIST = ''; -SET &CNTRY_COUNT = &LINES; -REPEAT :CTRYLOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -READ CTRYHLD &TMPVAR.A10 NOCLOSE -SET &CTRYLIST.&CNT = &TMPVAR; -:CTRYLOOP END -*------------------------------------------------------- -* Call the second procedure passing the value of country -*------------------------------------------------------- SET PAGE-NUM=NOPAGE SET PRINTPLUS=ON SET COMPOUND=OPEN
-SET &COUNT=0; -REPEAT SALES_LOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -SET &COUNT=&COUNT + 1; -TYPE TEST_01:Country =&CTRYLIST.&CNT -SET &PAGETYPE=IF &COUNT EQ &CNTRY_COUNT THEN 'Y' ELSE (IF &COUNT EQ 1 THEN 'F' ELSE 'L'); -TYPE TEST_01:PageType=&PAGETYPE EX test_02 COUNTRY='&CTRYLIST.&CNT', PAGETYPE='&PAGETYPE' -SALES_LOOP SET COMPOUND=CLOSE END
-* File test_02.fex -DEFAULT &COUNTRY='ENGLAND'; -DEFAULT &PAGETYPE='Y'; TABLE FILE CAR SUM SALES DEALER_COST BY COUNTRY WHERE (COUNTRY EQ '&COUNTRY') ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL
For future reference, this might be a little easier to debug (I don't like GOTO's):
-* File test_01.fex
TABLE FILE CAR BY COUNTRY ON TABLE HOLD AS CTRYHLD FORMAT ALPHA END -RUN
-*-------------------------------------------------------- -* Read the list of countries: -*--------------------------------------------------------
-SET &CNTRY_COUNT = &LINES; -REPEAT :CTRYLOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -READ CTRYHLD &TMPVAR.A10. NOCLOSE -SET &CTRYLIST.&CNT = &TMPVAR; -:CTRYLOOP -CLOSE CTRYHLD
-*------------------------------------------------------- -* Call the second procedure passing the value of country -*------------------------------------------------------- SET PAGE-NUM=NOPAGE SET PRINTPLUS=ON SET COMPOUND=OPEN
-REPEAT SALES_LOOP FOR &CNT FROM 1 TO &CNTRY_COUNT; -SET &OPEN_CLOSE = IF &CNT EQ &CNTRY_COUNT THEN 'CLOSE' ELSE - IF &CNT EQ 1 THEN 'OPEN' ELSE ' '; -SET &COUNTRY=&CTRYLIST.&CNT; -INCLUDE test_02 -SALES_LOOP
TABLE FILE CAR SUM SALES DEALER_COST BY COUNTRY WHERE (COUNTRY EQ '&COUNTRY') ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT PDF &OPEN_CLOSE ON TABLE SET STYLE * UNITS=IN, PAGESIZE='A4', SQUEEZE=OFF, ORIENTATION=LANDSCAPE, $ TYPE=REPORT, GRID=ON, $ ENDSTYLE END
Thanks dhagen! Its is working now. Is there anyway I can display all in one page or without the page breaks for each country?. Its displaying one page per country now.
new2focus I sent you a pm with my number, call me and we'll try to finish this up.
However, one thing I would do is put the following 2 lines at the top of test_02.fex.
-SET &ECHO=ON; -SET &STACK=OFF;
The &ECHO will display the resolved focus code, while the &STACK will tell WebFOCUS not to execute the focus code. This way, you can see the final focus code that will be executed, and eyeball it for errors.
When I changed the IF statement to the following (made it all on same line), then its displaying all the reports on the same page. It seems like Webfocus somehow didn�t like the IF on the next line.
-SET &OPEN_CLOSE = IF &CNT EQ &CNTRY_COUNT THEN 'CLOSE' ELSE IF &CNT EQ 1 THEN 'OPEN NOBREAK' ELSE 'NOBREAK';
Thanks a lot for your help dhagen. I truly appreciate your time. I am slowly making my way onto my ultimate challenge in Webfocus reporting. ( https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/ 7321058331/r/7321058331 ). It would be great if you could shed any ideas on how to generate this report. Once again thanks a lot for you help and time on this post. I learnt many new things today.This message has been edited. Last edited by: Kerry,