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.
Hi I would like to ask your assistance if it can be done. I have a launch page using 3-4 parameters, such as year, location etc. There is one parameter (ID) that I would like user to input 1 to many ssn which will be used to extract ssn's other database records information.
I'm thinking a TEXTAREA will work, but all the sample in the Focal point is only to use TEXTAREA as a FEX submission area.
Any idea to do this will be appreciated. Thanks
Prod: WebFOCUS 7.1.1 CGI - Self Service - Report Caster,Win2000/IIS Output: HTML, Excel 2000 and PDF
Posts: 36 | Location: LOS ANGELES | Registered: February 01, 2006
I'm not sure if I understand your question correctly. How may SS# are you planning to pass at a time? You might want to use text box and then parse it on the focexec.
WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
Posts: 285 | Location: Texas | Registered: June 27, 2006
The SSn will be entered by user in the launch page. The fex will work if there is only one ssn enter, but normal it could be 50, 100 etc.
Therefore, I think what I need is a way to allow user to enter the ssn and somehow there is a way to capture the entered and save in a file. Then the file will be used in a join command (join the ssn to the idssn in database) in order to extract database records
Prod: WebFOCUS 7.1.1 CGI - Self Service - Report Caster,Win2000/IIS Output: HTML, Excel 2000 and PDF
Posts: 36 | Location: LOS ANGELES | Registered: February 01, 2006
Are you using the SSN in WHERE statement? You should be able to grab all the SSN and parse it and the put in OR in between and then pass it back to the query. It might be helpful if you can upload your code.
WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
Posts: 285 | Location: Texas | Registered: June 27, 2006
Thanks for your ready. I guess I should revise my need and see whether it makes more sense.
I have a user would like to provide a file (list) of ssn (any number, 50, 100 etc) and we'll provide address listing for those ssn provided.
Currently, I copy the file (.txt) of ssn provided to a temp directory in the Webfocus server. A fex will read that .txt and convert that to a focus table, and use the ids to join the database. Address is extracted and listing is done.
Howwever, it will be nice if a launach page can be provided to user (self service) which allow them to enter all ssn needed (could be cut/paste from their own file). The entered id will then be read and stored in the server, cont to regualr process. The fex is done in a REMOTE server, and I've that cut/paste below for your reference. The immediate need is how to capture the inputed ssn Thanks for reading
REMOTE DEST=VMS
-REMOTE BEGIN TABLE FILE STUDFILE PRINT STUD_ID IF RECORDLIMIT EQ 1 ON TABLE HOLD AS X1 FORMAT ALPHA END -RUN VMS COPY FOCUXX:EOPS.DAT X1.FTM -RUN FILEDEF X1 DISK X1.FTM TABLE FILE X1 PRINT
STUD_ID IF STUD_ID GT '838000000' IF STUD_ID LT '838999990' ON TABLE HOLD AS LABDATA FORMAT ALPHA END -RUN JOIN CLEAR * JOIN STUD_ID IN LABDATA TO ALL STUD_ID IN STUDSS AS A3; END DEFINE FILE LABDATA LASTNAME/A29=EDIT (ST_NAME,'99999999999999999999999999999');
END -* -RUN TABLE FILE LABDATA PRINT
LASTNAME MAIL_STREET_ADDRESS MAIL_CITY MAIL_ST MAIL_ZIP BY STUD_ID ON TABLE HOLD AS W4750J2 FORMAT ALPHA END -RUN -* -REMOTE END -FEXIT
Prod: WebFOCUS 7.1.1 CGI - Self Service - Report Caster,Win2000/IIS Output: HTML, Excel 2000 and PDF
Posts: 36 | Location: LOS ANGELES | Registered: February 01, 2006
Pre-process your SSNs into a *.txt file with one SSN per line. Use a preceding *.fex that drives an HTML form, takes it's content, sorts it, and outputs it to a file that's been FD'd to a *.txt; or use a text editor to make a *.txt; or use Excel to make a 1 column spreadsheet and save it as *.txt.
After creating the list of SSNs as *.txt, use the 'in file' form of WHERE to incorporate that file into your reporting *.fex:
FD SSN_LIST DISK C:/path.../SSN_TEST_FILE.txt TABLE FILE .... ... WHERE SSN_FIELD IN FILE SSN_LIST ... END
Check the manuals I thing the values in a file used this way must be in ascending sequence.
WIN/2K running WF 7.6.4 Development via DevStudio 7.6.4, MRE, TextEditor. Data is Oracle, MS-SQL.
Posts: 154 | Location: NY | Registered: October 27, 2005
Cburtt Thanks for your hints. I have problem in the pre-processing. Any suggestion or sample will help me a lot in "A user will need a html or something to enter the ids, and the ids will be stored in xxx of the webfocus server"
I believe I'm getting closer to what I need with your previous reply. Thanks so much, and I'll continue to do more research on this topic too.
Prod: WebFOCUS 7.1.1 CGI - Self Service - Report Caster,Win2000/IIS Output: HTML, Excel 2000 and PDF
Posts: 36 | Location: LOS ANGELES | Registered: February 01, 2006
I've done this using the textarea, and some JavaScript to parse and validate the textarea data. The JS is probably about 30 lines.
The JS parses the data and converts it into a string that I use in an SQL PassThu In Statement ,.e.g, ('somevalue','anothervalue')
We validate it based on: 1. blank textarea 2. length of each line in the textarea 3. all numeric
The potential pitfall with this approach for your application is going to be the size of the query string getting passed. Don't know what the limit would be, but to use this you will have to put a limit on the number of SSN that would be input.
Cutting and pasting from other sources works fine.
SteveThis message has been edited. Last edited by: SteveH,
Posts: 6 | Location: Newport Beach, CA | Registered: December 22, 2006
If I were 50 to 100 values I would put them in a text or excel file but if you want to enter them manually just make the test entry box big enough to accomodate all of your SSNs and have your users separate each entry with a comma (whatever you wish) and the parse the result into a variable for the WHERE clause in your fex. See the sample below wher you can adjust the input and output legnths to whatever you need
Back in the "good old days" of character based FOCUS on mainframe, one method used to enable a similar process was to prompt the user each time for a string rather than have them enter a free format list. After they had entered the last one they had to enter "END" into the prompt to show that no more input was required.
You could use a similar method for your process. Just use a JavaScript prompt for the input and create a dynamic HTML form input tag with the same name attribute for each value entered by the user. When they entered "END" to the prompt then you could execute your HTML form.
One advantage of doing this - of each input tag having the same name value - is that WebFOCUS would interpret the multiple single variable names into a range of variables suffixed with a numeric indice -
&SSN1 &SSN2
it would also give you the number of occurences via the &SSN0 variable.
The key to creating a workable user interface is understanding how your users base likes to workand not force them into using your design of interface that might not fit the way they like to work.
If I get time I'll knock up an example for you.
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
OK, here is a very basic example of what I mean. It accepts User input, converts it to uppercase (to enable check for "END") and create a form control for each input made. The function create_control() is one that I use widely for dynamic control creation. At present it also creates a control for the "END" input. This could be discarded or dealt with as and when required.
The script appears after the "body" tag purposefully as I want the script to execute after page load and not via a function, but it could easily be converted to a function as necessary.
At the moment the controls are made visible but uncommenting the "type" assignment will make it hidden to the user.
You could add validation into the JavaScript using masked input - but I'll leave that to you
-HTMLFORM BEGIN
<html>
<head>
<title>JavaScript Prompt</title>
</head>
<body style="BACKGROUND-COLOR: rgb(240,245,255);" style="OVERFLOW: auto">
<form id="form" name="form" method="post" target="_blank" action="/ibi_apps/WFServlet">
<input type=hidden name="IBIF_ex" value="yourfex.fex">
<input type=hidden name="IBIAPP_app" value="baseapp" id="IBIAPP_app">
</form>
</body>
<script language="javascript">
// this could easily be in a function but here I want it to run after HTML load
do {user_input = prompt('Please enter a SSN or END to finish',' ');
if (user_input != ' ' && user_input != null) {
ssn_id = user_input.toUpperCase();
create_control("ssn_id","ssn_id",ssn_id);
} else {
ssn_id = "END";
}
}
while (ssn_id != "END");
function create_control(ctrl,name,value) {
var NewCtrl = document.createElement("input");
NewCtrl.setAttribute("id", ctrl);
NewCtrl.setAttribute("name", name);
// NewCtrl.setAttribute("type", "hidden");
NewCtrl.setAttribute("value", ssn_id);
document.form.appendChild(NewCtrl);
}
</script>
</html>
-HTMLFORM END
Enjoy.
TThis message has been edited. Last edited by: Tony A,
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
Tony Your code works well. I tried that and found only only problem since I have to enter 1 ssn at a time. If I can have a area (textarea?) or something that I can cut/paste all ids once for all, it will be perfect. However, I'll continue to try your code plus other method. Thanks for all replies. Good day.
Prod: WebFOCUS 7.1.1 CGI - Self Service - Report Caster,Win2000/IIS Output: HTML, Excel 2000 and PDF
Posts: 36 | Location: LOS ANGELES | Registered: February 01, 2006
You may notice that most regular posters have a signature line or lines on their postings. This is to help others to help the poster, by understanding what release of WF and on what platform(s). Please take the time to add your details into your profile within the signature box. Thank you
On your question, I do use a similar method that allows users to enter upto 25 items within one prompt. I then use the previous "create_control" function to add each value after first splitting the output into an array -
var sub_proj = prompt('Please enter the Sub Project Id(s) separated by a semi-colon (max. 25)','All');
if (sub_proj != ' ' && sub_proj != null) {
if (sub_proj != "All") {
// Split the input into an array. Currently set to a max of 25
var sprj_array = new Array(25);
sprj_array = sub_proj.split(";");
// Create a range of identically "named" new inputs to contain all the values in the array
for (i=0; i<sprj_array.length; i++) {
// Safety first! Check if control exists and delete if necessary
var RemCtrl = document.getElementById("SubProjID"+i);
if (RemCtrl) {
document.form.removeChild(RemCtrl);
}
create_control("SubProjID"+i,"SubProjID",sprj_array[i]+"%");
// alert("Value "+i+" is "+sprj_array[i]);
}
}
You could use this sort of code to interogate your textarea and create your controls.
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