|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Gold member |
I have a report that requires the users to input some values into a text box. I am not using the html layout painter, so I would like the text box to be within the fex. Is this possible?
This message has been edited. Last edited by: kerry, Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
||
|
|
Master |
There are only afew things that you can't do with WebFOCUS. This is not one of them, so yes it can be done. There are basicly two ways: the first means that you code your variables with a list of choices and let the autoprompt facility handle the rest. The second is that you code the html code in your fex, and run it; this means you;ll need a second fex to receieve the selected values.
I'm sure there are a lot of examples to be found, either within this forum, or on the IB tech support site. Hope this helps ... GamP
|
|||||
|
|
Gold member |
I have a field called forecast which has values
and I need a text box for the users to input suggested forecast sales: 100 200 300 500 800 900 forecast: 100 200 300 400 500 600 sug fct: ___ ___ ___ ___ ___ ___ Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Platinum Member |
Donald,
Here is an example: DEFINE FILE CAR INFLD/A255='<INPUT value=' | EDIT(RETAIL_COST) | ' name="SALESTEXT">'; END TABLE FILE CAR PRINT CAR INFLD END Use FTOA if you do not want the leading zeros in your value. Fernando Prod WF 7.13, QA WF 7.13, Dev WF 7.13 |
|||
|
|
Gold member |
THAT LOOKS GREAT!!! except for the leading zeros. I hate to sound ignorant, but can you show me where the FTOA would go in the code.
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Virtuoso |
You would add a field to the define in front of the INFLD to convert the field to alpha and specifiy a format that omits leading zeros. Then use that alpha field in the INFLD definition without the EDIT command.
Ginny --------------------------------- Prod: WF 7.6.5 with 7.6.6 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.6 WFRS; AIX 5.3; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Expert |
... and to learn about using functions such as FTOA, look towards your manuals of use the search function top right
T Old FOCUS coders never die, they just become functionally stable. (Tony A
|
|||||
|
|
Gold member |
It works for thje cars database,but for my application a am getting a blank text box instead of the quantity field.
ALPHA_FCT/A30 = FTOA(CURRQTYF, '(D20)', ALPHA_FCT); INFLD1/A100=''; Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Gold member |
ALPHA_FCT/A30 = FTOA(CURRQTYF, '(D20)', ALPHA_FCT);
INFLD1/A100='';
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Virtuoso |
Make sure that you put your code between the code tags, the red icon to the right of the posting box.
This works: DEFINE FILE CAR ALPHA_FCT/A30 = FTOA(RETAIL_COST, '(D20)', ALPHA_FCT); INFLD/A255='<INPUT value=' | ALPHA_FCT | ' name="SALESTEXT">'; -* INFLD/A255='<INPUT value=' | EDIT(RETAIL_COST) | ' name="SALESTEXT">'; END TABLE FILE CAR PRINT CAR INFLD END Ginny --------------------------------- Prod: WF 7.6.5 with 7.6.6 WFRS; AIX 5.2; WebSphere 6.1.0.15 Dev: WF 7.6.5 with 7.6.6 WFRS; AIX 5.3; WebSphere 6.1.0.15 Primarily self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable |
|||
|
|
Gold member |
that works now.. I had "SET SHOWBLANKS = ON" so by textbox was blank.. thanks for the advice.
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Gold member |
Last question is can I right justify the values in the text box.
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Master |
Donald,
There is some residual effects from the FTOA that you need to deal with. The FTOA function leaves leading blanks in the value. If you look at the source code of the report results you will see all the spaces. Here is some code that eliminates the blanks and adds the right justification for the INPUT box. My original suggestion for adding align=right was incorrect. DEFINE FILE CAR ALPHA_FCT/A30 = FTOA(RETAIL_COST, '(D20)', ALPHA_FCT); LEFTJ_FCT/A30 = LJUST(30,ALPHA_FCT,'A30'); INFLD/A255='<INPUT type="text" value="' || (LEFTJ_FCT || '" name="SALESTEXT" style="text-align:right">'); END TABLE FILE CAR PRINT CAR INFLD END Thanks! Mickey
|
|||||
|
|
Silver Member |
I know I'm jumping in a little late, but this concept intrigued me and I decided to see if I could bring this a step further and make things update dynamically within the report according to user input using some simple javascript. Here is what I came up with. I don't know if it is useful for anyone but, I found it interesting.
Eric DEFINE FILE CAR
RETAIL/A16=FTOA(RETAIL_COST,'(D12CM)',RETAIL);
END
TABLE FILE CAR
PRINT
-* INFLD
COMPUTE CNT/I4=CNT+1;
COMPUTE RETAIL_COST/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | ' value=' | EDIT(RETAIL_COST) | '>';
COMPUTE REBATE/A255='<INPUT id=rebate' | EDIT(CNT) | ' value="" onChange=projectFuture("' | EDIT(CNT) | '")>'; AS 'Rebate %'
COMPUTE MULT_INFLD/A255='<span id=infld' | EDIT(CNT) | '>calculation</span>';
BY CAR
END
-HTMLFORM BEGIN
<HTML>
<head>
<SCRIPT>
function projectFuture(num)
{
var costName='cost' + num;
var rebateName='rebate' + num;
var newCost=document.getElementById(costName).value * ((100 - document.getElementById(rebateName).value) / 100);
var idName='infld' + num;
document.getElementById(idName).firstChild.nodeValue=newCost;
}
</SCRIPT>
</HEAD>
-HTMLFORM END Eric Woerle WF 7.1.4 MRE |
|||
|
|
Gold member |
WOW,this is interesting... The users acually want 12 text boxes where they can input a 12 month forecast and then start changing some numbers to see what that does to the total..After going to summit this year I thought I was ready for anything but this had me stuck until now.
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Platinum Member |
That's great Eric, I can't wit till I need it...
|
|||
|
|
Gold member |
I need to save those values in the text box and send to someone for review. When I save the cars report with the javascript logic for calculations it opens with a blank text box instead of the value that was put into the text box.
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Gold member |
I still need someone to chime in on this..Is there a way to save this report with the calculated values?
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Master |
I think you are going to have to treat it like an input screen and write it to a file. You will need to incorporate a save button into the report.
Pat WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes |
|||
|
|
Gold member |
Can you give me an example using this cars report?
DEFINE FILE CAR
RETAIL/A16=FTOA(RETAIL_COST,'(D12CM)',RETAIL);
END
TABLE FILE CAR
PRINT
-* INFLD
COMPUTE CNT/I4=CNT+1;
COMPUTE RETAIL_COST1/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_1 value=' | EDIT(RETAIL_COST) | '>';
COMPUTE RETAIL_COST2/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_2 value=' | EDIT(RETAIL_COST) | '>';
COMPUTE RETAIL_COST3/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_3 value=' | EDIT(RETAIL_COST) | '>';
COMPUTE REBATE/A255='<INPUT id=rebate' | EDIT(CNT) | ' value="" onChange=projectFuture("' | EDIT(CNT) | '")>'; AS 'Rebate %'
COMPUTE MULT_INFLD/A255='<span id=infld' | EDIT(CNT) | '>calculation</span>';
BY CAR
END
-HTMLFORM BEGIN
<HTML>
<head>
<SCRIPT>
function projectFuture(num)
{
for (i=1; i<4; i++)
{
var costName='cost' + num + '_'+i;
var rebateName='rebate' + num;
var newCost=document.getElementById(costName).value * ((100 - document.getElementById(rebateName).value) / 100);
var idName='infld' + num;
}
document.getElementById(idName).firstChild.nodeValue=newCost;
}
</SCRIPT>
</HEAD>
-HTMLFORM END
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Guru |
Donald, try this out.
I called the fex FP_DB_UPDATE You will have to code the modify to do the update, and also pass back any key values. -DEFAULT &PART='FORM';
-GOTO PGM_&PART
-PGM_UPDATE
-? &
-EXIT
-PGM_FORM
DEFINE FILE CAR
RETAIL/A16=FTOA(RETAIL_COST,'(D12CM)',RETAIL);
END
TABLE FILE CAR
PRINT
-* INFLD
COMPUTE CNT/I4=CNT+1;
COMPUTE RETAIL_COST1/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_1 name=cost' | EDIT(CNT) | '_1 value=' | EDIT(RETAIL_COST) | '>';
COMPUTE RETAIL_COST2/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_2 name=cost' | EDIT(CNT) | '_2 value=' | EDIT(RETAIL_COST) | '>';
COMPUTE RETAIL_COST3/A255=RETAIL | '<INPUT type=hidden id=cost' | EDIT(CNT) | '_3 name=cost' | EDIT(CNT) | '_3 value=' | EDIT(RETAIL_COST) | '>';
COMPUTE REBATE/A255='<INPUT type=text id=rebate' | EDIT(CNT) | ' name=rebate' | EDIT(CNT) | ' value="" onChange=projectFuture("' | EDIT(CNT) | '")>'; AS 'Rebate %'
COMPUTE MULT_INFLD/A255='<span id=infld' | EDIT(CNT) | '>calculation</span><INPUT type=hidden id=outfld' | EDIT(CNT) | ' name=outfld' | EDIT(CNT) | ' value="")>';
BY CAR
ON TABLE HOLD AS RPT FORMAT HTMTABLE
END
-RUN
-HTMLFORM BEGIN
<HTML>
<head>
<SCRIPT>
function projectFuture(num)
{
for (i=1; i<4; i++)
{
var costName='cost' + num + '_'+i;
var rebateName='rebate' + num;
var newCost=document.getElementById(costName).value * ((100 - document.getElementById(rebateName).value) / 100);
var idName='infld' + num;
var outName='outfld' + num;
}
document.getElementById(idName).firstChild.nodeValue=newCost;
document.getElementById(outName).value=newCost;
}
</SCRIPT>
</HEAD>
<body>
<form action="/ibi_apps/WFServlet" method="get">
<input type="hidden" name="IBIF_ex" value="FP_DB_UPDATE">
<input type="hidden" name="PART" value="UPDATE">
!IBI.FIL.RPT;
<br>
<input type="submit">
</form>
</body>
</html>
-HTMLFORM END
Waz...
|
|||||||||||
|
|
Gold member |
Thanks for responding, I was starting to get worried that nobody could help with this one. I am not trying to save the values to a database,the users will be in a hotel plugging in values and then saving it to their local drive for later review. When they open the saved report they need to still see the values they put into the text box.
Prod: WebFocus 7.6.1 Win 2003 Dev: WebFocus 7.6.1 Win 2003 |
|||
|
|
Silver Member |
If they want to save it to their local computers, why not just dump it into excel? you could always create a blank field and write your formula into the compute so that they don't need to worry about it. But if they want to be able to save and work with it locally, that would be the way I would go.
Eric Woerle WF 7.1.4 MRE |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|