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     Looping thru HTMLFORM Begin and End

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Looping thru HTMLFORM Begin and End
 Login/Join
 
Member
posted
Hello All,

My user community wants to select multi countries (10 or so) and then have the reports output in HTML. I want to loop thru the Table file and with each new country output to HTML. The first country works fine, but no output on others (Japan).
Thanks in Advance
Here is the code.

-SET ECHO ON;
-SET &APP_EX = 'ITALY,JAPAN';
-SET &INCUST = '';
-SET &INCUST = &APP_EX;
-*****************************************
-*DETERMINE INCUST FOR MULTIBLE CUSTOMERS
-*****************************************
-DEFAULT APPEX = 0;
-SET &CTR=1;
-SET &PARSEVAL = STRIP(&APP_EX.LENGTH, &APP_EX, ',','A&APP_EX.LENGTH');
-SET &PARSEVAL = TRUNCATE(&PARSEVAL);
-SET APPEX = (&PARSEVAL.LENGTH / 5);
-:GETPARM1
-SET &APPEX.&CTR = GETTOK(&APP_EX,&APP_EX.LENGTH,&CTR, ',', &APP_EX.LENGTH, 'A&APP_EX.LENGTH');
-*SET &APPEX.&CTR = (&APPEX.&CTR/236);
-TYPE ............................
-TYPE APP_EX : &APPEX.&CTR
-TYPE ............................
-* File TESTRPT1.fex
TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
BODYTYPE
WHERE COUNTRY EQ '&APPEX.&CTR'
ON TABLE HOLD AS RPT1 FORMAT HTMTABLE
END

-HTMLFORM BEGIN
html
body
!IBI.FIL.RPT1 ;
/body
/html
-HTMLFORM END
-RUN
-SET &CTR = &CTR+1;
-IF &CTR LE &APPEX GOTO :GETPARM1;

This message has been edited. Last edited by: LCLMO37,
 
Posts: 2 | Registered: May 19, 2003Report This Post
Virtuoso
posted Hide Post
The basic issue is that you are trying to output more than one HTML page, which is not possible. You can change your existing code to output just one page by changing the single loop and having 2 loops, one for the table and one for the output, but the results are far from perfect:
-SET &ECHO=ALL;
-SET &APP_EX = 'ITALY,JAPAN';
-SET &INCUST = '';
-SET &INCUST = &APP_EX;
-*****************************************
-*DETERMINE INCUST FOR MULTIBLE CUSTOMERS
-*****************************************
-DEFAULT APPEX = 0;
-SET &CTR=1;
-SET &PARSEVAL = STRIP(&APP_EX.LENGTH, &APP_EX, ',','A&APP_EX.LENGTH');
-SET &PARSEVAL = TRUNCATE(&PARSEVAL);
-SET APPEX = (&PARSEVAL.LENGTH / 5);
-:GETPARM1
-SET &APPEX.&CTR = GETTOK(&APP_EX,&APP_EX.LENGTH,&CTR, ',', &APP_EX.LENGTH, 'A&APP_EX.LENGTH');
-*SET &APPEX.&CTR = (&APPEX.&CTR/236);
-TYPE ............................
-TYPE APP_EX : &APPEX.&CTR
-TYPE ............................
-* File TESTRPT1.fex
TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
BODYTYPE
WHERE COUNTRY EQ '&APPEX.&CTR'
ON TABLE HOLD AS RPT&CTR FORMAT HTMTABLE
END
-SET &CTR = &CTR+1;
-IF &CTR LE &APPEX GOTO :GETPARM1;
-HTMLFORM BEGIN
<html>
<body>
-SET &CTR=1;
-:GETTAB1
!IBI.FIL.RPT&CTR;
-SET &CTR = &CTR+1;
-IF &CTR LE &APPEX GOTO :GETTAB1;
<body>
<html>
-HTMLFORM END


Another approach, based on your example, could be:
-SET &ECHO=ALL;
-SET &APP_EX = 'ITALY,JAPAN';
-SET &SCREEN='''' || STRREP(&APP_EX.LENGTH,&APP_EX,1,',',6,''' OR ''',&APP_EX.LENGTH+100,'A100') || '''';
TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
BODYTYPE
WHERE COUNTRY EQ &SCREEN
ON TABLE PCHOLD AS RPT FORMAT HTML
END


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
The idea is:
-HTMLFORM BEGIN
<html>
<body>
!IBI.FIL.RPT1;
!IBI.FIL.RPT2;
!IBI.FIL.RPT3;
... etcetera
</body>
</html>
-HTMLFORM END

kick it up a notch and place your reports anywhere you want on the screen...
if your user only chooses 2 countries, there is no RPT3, and the nice thing is, it doesn't matter.
-HTMLFORM BEGIN
<html>
<body>
<table><tr><td>
!IBI.FIL.RPT1;
</td><td>
!IBI.FIL.RPT2;
</td><td>
!IBI.FIL.RPT3;
</td></tr></table>
... etcetera
</body>
</html>
-HTMLFORM END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Thanks for the input. Using Alan B. 1st suggestion could work. What I did not state was that I need to loop thru 7 different reports as well. (Not shown) I will report more later.

here is revised code.

-SET ECHO ON;
-SET &XREPORTVALUE='1,2,3,4,5,6,7';
-SET &ALLAPP_EX = 'ITALY,JAPAN';
-SET &ALLINCUST = '';
-SET &ALLINCUST = &ALLAPP_EX;
-*****************************************
-*DETERMINE INCUST FOR MULTIBLE CUSTOMERS
-*****************************************
-DEFAULT ALLAPPEX = 0;
-SET &ALLCTR=1;
-SET &PARSEVAL = STRIP(&ALLAPP_EX.LENGTH, &ALLAPP_EX, ',','A&ALLAPP_EX.LENGTH');
-SET &PARSEVAL = TRUNCATE(&PARSEVAL);
-SET ALLAPPEX = (&PARSEVAL.LENGTH / 5);
-:ALLGETPARM1
-SET &ALLAPPEX.&ALLCTR = GETTOK(&ALLAPP_EX,&ALLAPP_EX.LENGTH,&ALLCTR, ',', &ALLAPP_EX.LENGTH, 'A&ALLAPP_EX.LENGTH');
-TYPE ............................
-TYPE ALLAPP_EX : &ALLAPPEX.&ALLCTR
-TYPE ............................
-* File TESTRPT1.fex
TABLE FILE CAR
PRINT COUNTRY
CAR
MODEL
BODYTYPE
WHERE COUNTRY EQ '&ALLAPPEX.&ALLCTR'
ON TABLE HOLD AS RPT&ALLCTR FORMAT HTMTABLE
END
-SET &ALLCTR = &ALLCTR+1;
-IF &ALLCTR LE &ALLAPPEX GOTO :ALLGETPARM1;
-SET &APP_EX = &XREPORTVALUE;
-TYPE &XREPORTVALUE
-SET &ALLCTR=1;
-TYPE THE ALLCTR VALUE IS: &ALLCTR
-RUN
-HTMLFORM BEGIN




-*****************************************
-*DETERMINE WHAT REPORTS WERE SELECTED
-*****************************************
-DEFAULT APPEX = 0;

-SET &CTR=1;
-SET &PARSEVAL = STRIP(&APP_EX.LENGTH, &APP_EX, ',','A&APP_EX.LENGTH');
-SET &PARSEVAL = TRUNCATE(&PARSEVAL);
-SET APPEX = (&PARSEVAL.LENGTH / 1);
-:GETPARM1
-:GETTAB1
-SET &APPEX.&CTR = GETTOK(&APP_EX,&APP_EX.LENGTH,&CTR, ',', &APP_EX.LENGTH, 'A&APP_EX.LENGTH');
-SET &REPORTNO = &APPEX.&CTR ;
-TYPE ............................
-TYPE APP_EX: &APPEX.&CTR
-TYPE PARSEVAL: 1 &APP_EX 2 &APP_EX.LENGTH 3 &CTR 4 A&APP_EX.LENGTH
-TYPE ............................
-SET &LASTFIELD1 = SUBSTR(&APP_EX.LENGTH, &XREPORTVALUE, &APP_EX.LENGTH, &APP_EX.LENGTH, 1, 'A1');
-TYPE LASTAFIELD: &LASTFIELD1
!IBI.FIL.RPT&ALLCTR;
-SET &CTR = &CTR+1;
-IF &CTR LE &APPEX GOTO :GETTAB1;
-SET &ALLCTR = &ALLCTR+1;
-SET &CTR=1;
-IF &ALLCTR LE &ALLAPPEX GOTO :GETPARM1;


-HTMLFORM END
-EXIT
-RUN
 
Posts: 2 | Registered: May 19, 2003Report This Post
Virtuoso
posted Hide Post
You shouldn't even need to worry about the HOLD AS HTMTABLE and -HTMLFORM. If you're just outputting to HTML, just run them one after the other in your loop and they come out in HTML one after the other.


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     Looping thru HTMLFORM Begin and End

Copyright © 1996-2020 Information Builders