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 run a report multiple times like below.
TABLE FILE REPORT_GETFILTERS_SKP
PRINT
FILTERS
ON TABLE SAVE AS BRANCHLIST
END
-RUN
-SET &NumberOfBranches = &LINES;
-SET &Counter = 0;
-REPEAT BranchLoop &NumberOfBranches TIMES
-READ BRANCHLIST NOCLOSE &Filters.A6.
-SET &Counter = &Counter + 1;
-INCLUDE test_12345
-RUN
-IF &Counter EQ &NumberOfBranches GOTO EndFex;
-BranchLoop
-EndFex
I am hoping for the fex test_12345 to run multiple times, for each parameter value &Filters passed to it. But it is running just once. What am I doing wrong ? (Am I doing anything right ? )
Thanks, ShravanThis message has been edited. Last edited by: Kerry,
7.7.03, Windows 7, SQL Server 2005
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008
Here is an example of a loop process using the CAR file.
-*********************************************************** -* TABLE FILE CAR PRINT COUNTRY ON TABLE SAVE AS BRANCHLIST END -RUN -* ******* BEGIN LOOP ******* -:LOOPER -READ BRANCHLIST NOCLOSE &FILTERS.A10. -IF &IORETURN NE 0 GOTO :EOF; TABLE FILE CAR HEADING "THIS REPORT IS FOR - &FILTERS" PRINT CAR BY COUNTRY WHERE COUNTRY EQ '&FILTERS' END -RUN -GOTO :LOOPER -:EOF -CLOSE BRANCHLIST -* ******* END LOOP ******* -****************************************************
Hope this helps. Jim
WebFocus 8.201M, Windows, App Studio
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008
If the report runs multiple times, you have to do something with each report run or you will just get the last one in your browser. 1. Hold them to disk or 2. Compound them together.
What you said definitely makes sense: If the report runs multiple times, you have to do something with each report run or you will just get the last one in your browser. But only the first report is showing up for me (not the last one as you mentioned). I will try the first option you mentioned (HOLD), because in my case Compounding is not an option.
I will keep you guys posted. Thanks.
7.7.03, Windows 7, SQL Server 2005
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008
Are you running this online, or scheduled in Report Caster? -- RC stops the job as soon as the first formatted output is produced, so you would wind up with only the first iteration's output.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I am trying to run this online, but eventually I wanted to schedule this on Report Caster. It is comforting( ) to know that RC stops the job as soon as the first formatted output is produced. So, what is the best way to do make RC iterate through a list of filters and produce the reports and save them to library ? If there is no way for me to make RC do that, I would at least try to generate these reports online, and develop my own scheduling program which can run this report at a scheduled time. Any ideas how I can generate a report multiple times using a loop ?
Thanks, Shravan
7.7.03, Windows 7, SQL Server 2005
Posts: 92 | Location: Carmel, IN | Registered: May 09, 2008
Here's the CAR example again that creates a pdf report for each country in the CAR file. A new pdf file is created for each iteration thru the loop. The last part of this runs a DIR command that lists all files in the temp directory.
-*************************************************************************** -* TABLE FILE CAR PRINT COUNTRY ON TABLE SAVE AS BRANCHLIST END -RUN -SET &NumberOfBranches = &LINES; -SET &Counter = 0; -REPEAT BranchLoop &NumberOfBranches TIMES -READ BRANCHLIST NOCLOSE &Filters.A10. -SET &Counter = &Counter + 1; -*-INCLUDE test_12345 -******************************************* -** CREATES PDF REPORT NAMED MyReport_X.pdf -** - WHERE X IS THE COUNTER IN LOOP PROCESS -******************************************* -SET &MyReport = 'MyReport_' || &Counter || '.pdf'; -* FILEDEF OUT_PDF DISK &MyReport -* TABLE FILE CAR HEADING "THIS REPORT IS FOR:" " " "Filters: &Filters" "MyReport: &MyReport" " " PRINT CAR BY COUNTRY WHERE COUNTRY EQ '&Filters' ON TABLE HOLD AS OUT_PDF FORMAT PDF END -******************************************* -** THIS IS WHERE YOU WOULD NEED TO COPY -** THE REPORT TO A NETWORK DRIVE -******************************************* -TYPE Filters = &Filters ~~~ Counter = &Counter ~~~ NumberOfBranches = &NumberOfBranches ~~~ MyReport = &MyReport -RUN -IF &Counter EQ &NumberOfBranches GOTO EndFex; -BranchLoop -EndFex -RUN -******************************************* -** LISTS ALL FILES IN TEMP DIRECTORY -******************************************* CMD DIR *.* -*************************************************************************************************
Hope this helps.
~Jim
WebFocus 8.201M, Windows, App Studio
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008
I am guessing you are using PCHOLD on the test_12345.fex. If so, please change it to
[code] ON TABLE HOLD AS HOLD&Filters FORMAT FOCUS [\code]
When PCHOLD is used, the loop breaks in the first iteration. So try to get all the informations in multiple HOLD files and then Merge them into one using "MORE" command. Let me know if this helps.
Release : 7.7.02 OS : Linux App Server : Tomcat all output
almost... you're going to loop twice. ...initialize your kounter first loop creates the individual HTML output each time, and gives it a name ON TABLE HOLD AS MYTAB&kounter FORMAT HTML END ... and keep track of however many you have creaated ...reinitialize a kounter then in your output area -HTMLFORM BEGIN -* looop in here from 1 to however many you've made !IBI.FIL.MYTAB&kounter; -* end of 2nd loop -HTMLFORM END
another advantage of such an approach is that you can use html table tags inside the -HTMLFORM calls to place reports next to each other, etc, really design your output page
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
but that only works for a very few very fast reports. the [u]whole point[/u] of a non-persistent connection is to drop the server connection as soon as the report hits the screen. therefore the outputs must be saved to the agent, and then dumped out together , allowing one final disconnect.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
If your goal is to do this with report caster, here is what we do:
Over time (mostly an hour), parameters for a report are submitted and stored in a file. Every hour we run a job that does this:
1. Pre-process that checks for a row to process, if no row, end job: 2. If row found in 1 above, process and distribute the report and mark row as processed 3. Post process to resumbit the job.
This loop continues until there is nothing left to process.
We use the DSTRUN subroutine in the post-process.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006