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     [CLOSED] Looping through pdf form

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Looping through pdf form
 Login/Join
 
Member
posted
I have a pdf form that I created in composer which is just populated with variables pulled from a SQL database. I created three variations based on whether the pdf should be open, close or blank depending on how many sets of variables are returned. I can only get the pdf to generate the first page of the report even though I loop through the code. Can someone take a look at this code and tell me what I am doing wrong? Do I have to hold this file somewhere to get the other pages to generate?

-*Grab all the school group reservations for the previous day and put them in a HOLD file
ENGINE SQLMSS SET DEFAULT_CONNECTION OutboundSoftwareZoo
SQL SQLMSS PREPARE SQLOUT FOR
SELECT CAST(row_number() over(order by R.ResID) AS INT) AS ID,CAST(CONVERT(DATE,A.ActDateTime,101) AS CHAR(10)) AS VISIT,CAST(R.ResName AS CHAR(56)) AS ORGANIZATION,
CAST((C.FirstName +' '+ C.LastName) AS CHAR(52)) AS CAREOF,CAST(C.[Street 1] AS CHAR(56)) AS ADDRESS,CAST((C.City + ', ' + C.State + ' ' + C.Zip) AS CHAR(85)) AS CITYSTATE,
CAST(C.[Home Phone] AS CHAR(31)) AS PHONE,CAST(CASE WHEN A.ActivityID = '1828' THEN 'Franklin' ELSE 'Non-Franklin' END AS CHAR(18)) AS COUNTY,CAST(A.DisplayTimeLabel AS CHAR(56)) AS TIME
FROM Reservations AS R JOIN Activities AS A ON R.ResID = A.ResID JOIN Customers AS C ON R.CustomerID = C.Customer#
WHERE R.ResDateCreated BETWEEN '20150917' AND DATEADD(d,1,'20150917')
AND (A.ActivityID = '1828' OR A.ActivityID = '1829') ORDER BY R.ResID
END
-RUN
TABLE FILE SQLOUT
PRINT *
BY ID
ON TABLE HOLD AS SCH_LIST
END
-SET &COUNTER = &LINES;
-*------------------------------LOOP-----------------------------------
-REPEAT LOOP &COUNTER TIMES;
-*-SET &CMP_FLG = IF &LOOP EQ &COUNTER THEN 'CLOSE' ELSE IF &LOOP EQ 1 THEN 'OPEN' ELSE '';
TABLE FILE SCH_LIST
PRINT ID VISIT ORGANIZATION CAREOF ADDRESS CITYSTATE PHONE COUNTY TIME
WHERE ID = &LOOP;
ON TABLE SAVE AS SCH_FORM
END
-RUN
-READ SCH_FORM &ID.I11. &VISIT.A10. &ORGANIZATION.A56. &CAREOF.A52. &ADDRESS.A56. &CITYSTATE.A85. &PHONE.A31. &COUNTY.A18. &TIME.A56.
-TYPE &ID
-TYPE &ORGANIZATION
-TYPE &CAREOF
-TYPE &ADDRESS
-TYPE &CITYSTATE
-TYPE &VISIT
-TYPE &TIME
-TYPE &COUNTY
-TYPE &PHONE
-TYPE &EXTRA
-TYPE &LOOP
-TYPE &COUNTER
-*Create the pdf form for this school group
-IF &LOOP EQ 1 GOTO OPEN ELSE IF &LOOP EQ &COUNTER GOTO CLOSE ELSE GOTO MIDDLE;
-OPEN
-INCLUDE schoolgroups_forma.fex
-GOTO FORMOUT
-MIDDLE
-INCLUDE schoolgroups_formb.fex
-GOTO FORMOUT
-CLOSE
-INCLUDE schoolgroups_formc.fex
-FORMOUT
-SET &LOOP = &LOOP + 1;
-*------------------------------ END LOOP-----------------------------------
END
-LOOP

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.04
Windows 7, All Outputs

 
Posts: 7 | Registered: May 29, 2012Report This Post
Virtuoso
posted Hide Post
How do you know how many columns ID spans?

You could simplify things considerably (avoiding the SAVE step), by using -READFILE in the loop.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
I am not sure what you mean by columns. Good idea I will definitely make that change.


WebFOCUS 8.04
Windows 7, All Outputs

 
Posts: 7 | Registered: May 29, 2012Report 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     [CLOSED] Looping through pdf form

Copyright © 1996-2020 Information Builders