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.
This will be more for production. I'm figuring I can use this approach to show the first report of 3 compound reports(excel and pdf). The first is the front page and it will display the user input. The subsequent reports will print with the data coming back from a sql stored proc. The issue I have is if I tie the first report to a result set and that result set comes back empty then the front page will not show. I need the front page to show always.
Let me see if I can explain this right. Try following the below steps and see if this is what you want.
1) Running the following code will place data into an edapath (appath) folder.
FILEDEF TESTCAR DISK C:\ibi\apps\baseapp\testcar.ftm
TABLE FILE CAR
SUM
RETAIL_COST
DEALER_COST
BY
COUNTRY
BY
CAR
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS TESTCAR FORMAT ALPHA
END
-RUN
2) You will need to create a master file for the data you placed on the edapath.
Can you turn EMPTYREPORT on and make the user supplied parms a report heading? Example with the infamous car file:
SET EMPTYREPORT=ON -DEFAULT &FIELD1 = 'CAR'; -DEFAULT &FIELD2 = 'MODEL'; TABLE FILE CAR ON TABLE PAGE-BREAK AND SUBHEAD "Fields selected: &FIELD1" "&FIELD2" "More fields... etc. 1" PRINT &FIELD1 &FIELD2 BY COUNTRY WHERE COUNTRY EQ 'MONKEY' ON COUNTRY PAGE-BREAK ON TABLE PCHOLD FORMAT PDF END
You'd need to tweak this but it might get you started...
Posts: 118 | Location: DC | Registered: May 13, 2005
This is a piece of code that I use occasionally to generate the contents for a combo box when I need to "invent" data. The basic principle is creating a dummy file that resides only in the EDATEMP folder and, providing you don't have TEMPERASE=OFF, the file will be deleted when the agent process ends.
APP FI mcgyver DISK mcgyver.MAS
-RUN
-WRITE mcgyver FILE=mcgyver,SUFFIX=FOC
-WRITE mcgyver SEGNAME=SEG1
-WRITE mcgyver FIELD=DATA_KEY,,I9,I4,$
-RUN
USE mcgyver.FOC NEW
END
-RUN
CREATE FILE mcgyver
-RUN
MODIFY FILE mcgyver
FIXFORM DATA_KEY/A9
MATCH DATA_KEY
ON NOMATCH INCLUDE
DATA
1
2
3
4
5
6
7
8
END
-RUN
DEFINE FILE mcgyver
DISPLAY/A15 = DECODE DATA_KEY(1 'Display Value 1' 2 'Display Value 2' 3 'Display Value 3'
4 'Display Value 4' 5 'Display Value 5' 6 'Display Value 6'
7 'Display Value 7' 8 'Display Value 8' ELSE 'FOC_NONE');
END
TABLE FILE mcgyver
PRINT DISPLAY
BY DATA_KEY
ON TABLE PCHOLD FORMAT XML
END
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
Yes, as all that this is doing is creating a FOCUS database in EDATEMP.
If you really mean "can I do this in MS SQL" then the answer is dependant upon the write perissions you have to the database to which you are connecting, plus create authority etc.
Basically you would perform SQL passthru to create the table with the specifications and then use INSERT to add the necessary rows of data.
HOWEVER, this does not create a temporary table and it will need to be deleted at the end of your process.
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
I would prefer not to have to go to those lengths. But if I have to I will, not yet as familiar with Focus to know it’s limitations. If you’re familiar with any of these terms you'll know what I ultimately want to do in Focus. SQL #temp table of type temp. A table that only exists in memory VB.net table object. Only exist in memory not on the physical database VB 6 or VBA recordset. Only exist in memory and is derived most of the time from the result of an SQL query. Looking for a similar construct in Focus. An object that I can be populated with records and used and then discarded as soon as the procedure is done executing. The most basic concept is a two dimensional array that can be populated used and discarded.
I hope this helps.This message has been edited. Last edited by: rc,
If I read your second post correctly, you basically want to accept user input (from an HTML page presumably?) and then display this on a first page of a compound report.
If this is the case then you do not have to tie it into another result set (per se). You could just place all the variables being passed to your procedure into a HEADING and then execute an empty report page,
For instance, suppose your user has to choose a number of variables from combo boxes on your HTML page - for example &Var1 through &Var8. Then your procedure could be something like -
-* Always default the incoming variables so that testing is easier.
-DEFAULT &Var1 = '', &Var2 = '', &Var3 = '', &Var4 = '', &Var5 = '', &Var6 = '', &Var7 = '', &Var8 = ''
-* Ensure empty reports are shown
SET EMPTYREPORT = ON
TABLE FILE filename
-* This extracts just one row from the resultset and doesn't print it.
PRINT somefield NOPRINT
IF RECORDLIMIT EQ 1
-* This is where your variables are used on the first page
HEADING
"Report for someone using parameter input as follows :-"
"&Var1"
"&Var2"
"&Var3"
"&Var4"
"&Var5"
"&Var6"
"&Var7"
"&Var8"
ON TABLE PCHOLD FORMAT format OPEN
END
-RUN
TABLE FILE filename
SUM numeric_field
more fields
BY sort_field etc.
WHERE field1 EQ '&Var1'
AND field2 EQ '&Var2'
AND etc.
ON TABLE PCHOLD FORMAT format
END
-RUN
more reports as required.
SET COMPOUND = CLOSE
The first report will always have content, the second will have content if the result set is not empty or will show the HEADING and FOOTING components if the resultset is empty.
As I say, I think is what you really want and not a temporary file that you can push the user input into to then extract from it. If not then let us know and we'll try again.
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
Thanks all. Tony A approach worked great. What is the run with "-" Why can I use the Set right before the Table File filename and inside the Table File I have to use -Set ??
The -RUN forces the execution of the stack and, as all commands preceded by a hypen, is a dialogue manager command. There are some good explanations in this forum (somewhere).
As per the above, there is a difference between the -SET and just plain SET. What SET do you mean and what is the full string you are refering to?
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
rc, For a very old, but still relevant, example of how dialogue manager controls the flow of your procedure, check out this link. You will need an inforesponse login to view it.
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