Focal Point
Save user input From an HTML page

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5091049482

May 21, 2008, 08:12 AM
Linda A
Save user input From an HTML page
WE would like to know if there is a way to save several of the same input. For example say Student id entered via a dashboard would be put into a hold file and then used to run a report.
this question was posed at our user conference
but the only answer we received was the input file option. I am sure there must be a way to save input from an html page then setup a button to run a report using that input.
Any help or ideas?


Linda A
WeFOCUS 7.7.03
Client Windows Server 2003 VM
Reporting Server Unix
Solaris 10
May 21, 2008, 08:47 AM
Tom Flynn
Linda,

If you are using HTML Painter, there is a Save Parameter button on the top right of the toolbar. This will allow the user to save there choices to a fex under My Reports. They will then run it from there.

Some documentation can be found here

Also, we do not know what version, platform, etc. you are running under, please use these instructions so we can assist you...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 21, 2008, 08:51 AM
Tony A
Linda,

At a previous contract I proto-typed something like you describe. I used a JavaScript function to read the DOM and then used AJAX to modify a SQL Sever table with all the variables from the HTML form. Using a simple fex to read that table and create a fex with all the &vars set accordingly is a simple and logical progression from that.

You can read the DOM using -
for (i=0;i<document.all.length;i++) {
}


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 
May 21, 2008, 09:23 AM
Linda A
Thank you Tony A and Tom for your ideas.
Tom - I think the save is not what I am looking for. What I really need is an input field that the user can enter data into and it will save the data to a hold file.
What I want to do is create an html page that I can put on a dashboard that has a field for the user to enter the student id's
Then save that input which could be anywhere from 1 to 100 id's to a hold file. then use that as my parameters for the report to run, in this case it will create mailing labels.


Linda A
WeFOCUS 7.7.03
Client Windows Server 2003 VM
Reporting Server Unix
Solaris 10
May 21, 2008, 09:47 AM
Tom Flynn
Linda,

I am hoping that, if you are at a school with 15,000 students, you DO NOT want to build a list box with all those ID's????

Maybe a range?

1. You could use the AUTOPROMPTER, with -PROMPT Beg ID and End ID
2. Build a form where they enter a range, you execute a fex, and populate a list box with those values.
3. Read in a spreadsheet that has all the ID's for the mailing.
4. etc.

Lot's of options. Others will have some ideas too, I hope...

Hope this helps.

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 21, 2008, 02:18 PM
Linda A
Tom,
thanks for the ideas. no I don't want to build a list box. I want the user to be able to enter the id's and save them. Like Data Entry. the end user would probably not go over 100 entry's but I would have no idea what the range of id's would be.

The read in a spreadsheet opiton sounds more like what we want to do.

Thanks for all the ideaas.

If we figure out a way I will share.


Linda A
WeFOCUS 7.7.03
Client Windows Server 2003 VM
Reporting Server Unix
Solaris 10
May 21, 2008, 02:37 PM
Fernando
Linda,

You may want to try combining the ideas of Tony and Tom in a slightly different way.

Build your screen with a text entry and a multiple select list box (which you can hide later). The type in an entry and clicks save and then finally run when they are done. The save uses javascript to dynamically create an entry in your listbox. The run selects every itme and then submits the form.

Your list box selects will then be available to your fex inside one variable.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
May 22, 2008, 05:31 AM
Tewy
If your users are typing the student ids into a text box, there's two options I can think of.

1. tell the user to enter a specific delimiter between the ids, which you can then process using WebFOCUS to create the list of ids for your query (If you trust your users to use the correct delimiter - you'd need some Javascript or something to check your box and make sure the formats are as you'd expect).

E.g. 12345,23456,34567 etc. where your delimiter is a ',' and the values can be substringed on your delimiter. If you need to store the ids, you could easily output the result to a holdfile.

2. Get them to enter one id at a time and click a button. That button could run a fex which appends each id to the bottom of a holdfile storing any previously entered. You'd need to have a way of creating a unique name for the holdfile so that if multiple users were using your form their ids would be stored in different holdfiles.

e.g. for one of my sites, each person has a unique login, I may capture that as the name of the holdfile. Then when the code runs it could check for the existence of the holdfile, if it doesn't exist it creates it, if it does exist it appends the new id to the bottom. When the final query is run, the holdfile of ids once used could then be deleted so that a new query could be started.

Not sure if either of these would work for you, I'm just thinking out loud.


WF 7.6.11
Output: HTML, PDF, Excel
May 22, 2008, 05:46 AM
GamP
And another option is to use a text-area (or multieditbox) or whatever it is called.
In this area you can type the ID's, one per line, separated with returns, and after being done entering ID's, the user can just hit the 'Run Report' button. Action behind the Run Report button would have to be a simple piece of javascript code, that converts all returns in the textarea value to a less offending (to webfocus) delimiter (like for instance a ~) and after that fire off the url for the report. The content of the textarea will now be available to webfocus as a single &variable. You can use a simple gettok loop to extract all ID's from the variable and put them in a hold file or ... (there are a number of options here to continue).

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
May 23, 2008, 10:55 AM
dcj
Linda,

We do something similar were we've created a Add/Change/Delete (ACD), fex, which allows our users to not only enter values, but maintain their list. Our ACD app captures information such as userid, name, start date, end date, department. This information is saved, updated or deleted from a database depending on the users action. I would suspect you could use a focus database if necessary. Our technique is to put the html in the fex so we can maintain communication back and forth between the html/fex and fex/html. Once the data is saved this infomation is used for numerous reports. We use report caster to backup our data to a hold file on a nightly basis for recovery purposes.


wf: 7.6.4
App. and reporting server: UNIX/AIX 5.3