Focal Point
[CLOSED] Input box and update button to update record

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

January 16, 2017, 01:18 AM
AR
[CLOSED] Input box and update button to update record
Hi All

I am looking for a code which has input box and button in a report. The update button will trigger the update statement which would have identified record uniqueness ID and input box value and will update the table in the database. I am confused with the flow. please help me out.

Thanks!

WF 8.1.0.5

This message has been edited. Last edited by: Tamra,


WebFOCUS 8
Windows, All Outputs
January 16, 2017, 04:12 AM
Avinash
1. Simple use a HTML page with input box and button. Clicking on button call a WF procedure having Update code via SQL passthru.
2. if you have knowledge of WF maintain then you can use Maintain to achieve this.

Hoping that this will solve your problem.


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs
January 16, 2017, 04:23 AM
AR
Hi Avinash

Thanks for the suggestion.
But the requirement is to show report of all records available in the db table and also show a comment column which will be blank initially. As i explained earlier a input box i want to show for each row and whatever user add in the input box will be updated in the comment column.
Dont want HTML driven.

Thanks!


WebFOCUS 8
Windows, All Outputs
January 16, 2017, 05:11 AM
Avinash
quote:
Thanks for the suggestion.But the requirement is.


Then the simplest way to use WF Maintain. Using WF maintain, you can achieve this.


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs
January 17, 2017, 12:14 AM
AR
We don't have license of WF Maintain.
Any other suggestion?


WebFOCUS 8
Windows, All Outputs
January 17, 2017, 05:58 AM
Avinash
As per my knowledge WF maintain is the best option for your requirement.

But you can do one thing that
1. design a temp hyperlink column like (Add comment) and link that hyperlink to a html page.
2. On the basis of row id, fill the control of html for that particular row and add one more control - Comment
3. While clicking on submit button use a procedure which is having SQL passthru update code.

Let me know that if this work for you.


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs
January 17, 2017, 10:20 AM
Maintain Wizard
I agree that Maintain really is the solution you need. We can easily create a form for you to drilldown into from your report.

Changes can be reflected immediately on your report.

Mark
January 17, 2017, 12:25 PM
eric.woerle
Use the modify syntax to write back to the table. It doesn't require a maintain license. Here is a simple example:


TABLE FILE CAR
SUM MODEL
COMPUTE NEW_VALUE/A255V=&MY_INPUT.QUOTEDSTRING;
BY CAR
WHERE CAR EQ &CARS
ON TABLE HOLD AS MY_UPDATES FORMAT ALPHA
END

MODIFY FILE [TABLE_NAME]

FIXFORM FROM MY_UPDATES

MATCH CAR
	ON MATCH UPDATE MODEL NEW_VALUE
	ON NOMATCH INCLUDE CAR MODEL NEW_VALUE
	DATA ON MY_UPDATES
END  


I'm not sure by what you mean by Don't want HTML Driven. WebFOCUS does everything through html on the front end... But you can use the FIND syntax and the default prompting abilities if you don't know how to write an HTML page. Although, validation would be more difficult.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
January 18, 2017, 04:50 AM
Avinash
quote:
=&MY_INPUT.QUOTEDSTRING

Hi Eric,
Thanks for providing the solution using MODIFY keyword. It is really helpful to write the data in table.
But as I understand that requirement is that "Every row need to editable and user can add comment in every row of data and while clicking on submit button record need to updated into DB" Not for a single row or where based condition update.

Let me know if I'm wrong.


Thanks!
@vi

WebFOCUS 8105, Dev Studio 8105, Windows 7, ALL Outputs
January 18, 2017, 05:21 AM
AR
Hi Eric & Avinash

I want something like below code. Instead of master view i want to use SQL and want to update table data and not a hold file data. I am not understanding the code snippet to modify it as per my requirement. It would be helpful if I get explanation for the keywords used. Do you have any help files?

 
-* File: IBFS:/localhost/WFC/Repository/Public/Features/Report7.fex Created by WebFOCUS AppStudio
-SET &ECHO=ALL;
-* File twanette01.fex
-*
-* Display
DEFINE FILE COURSE
THE_KEY/A80     = '<input type=hidden value="' || COURSECODE || '" name ="COURSECODE">' ;
END
-RUN
-*
USE
FOCALPOINT/COURSE.FOC AS COURSE
END
-RUN
TABLE FILE COURSE
IF COURSECODE EQ 'E$*'
PRINT
COMPUTE LL/I3=LAST LL + 1; NOPRINT
COMPUTE ULL/A4='U' | LJUST(3, FPRINT(LL, 'I3', 'A3'), 'A3'); NOPRINT
THE_KEY AS ''
COURSECODE
COMPUTE THE_VALUE/A250 = '<input type="radio" name="' | ULL | '" value="Y">Y ' |
                         '<input type="radio" name="' | ULL | '" value="N" checked>N ' |
                         '<input value="' || CTITLE || '" name ="CTITLE" size=45 maxlength=45>' ;
                         AS 'Update the Course Name?'
-*
BY COURSECODE NOPRINT
ON TABLE SAVE AS THE_FILE FORMAT HTMTABLE
END
-RUN
-SET &MOD_LINES = &LINES ;
-*
-HTMLFORM BEGIN
<html><head></head>
<body>
<form  method="post" name="modform" action="/ibi_apps/WFServlet">
<input type=submit value="Update" name="ok">
!IBI.FIL.THE_FILE;
<input type=hidden name="MOD_LINES" value="!IBI.AMP.MOD_LINES;">
<input type=hidden name="IBIF_ex" value="course2">
</form>
</body>
</html>
-HTMLFORM END

 


Thanks!
January 27, 2017, 03:45 PM
Tamra
There is also the option to use SQL to update a data table. This is similar to the Modify solution provided by Eric.

With a combination of an HTML page and in the backend use of SQL insert/update.

Here is a link to Using SQL to create reports and SQL INSERT, UPDATE, and DELETE Commands

Maintain is as others have mentioned the best way to resolve your dilemma.

Thank your for participating in the Focal Point Forum,

Tamra Colangelo
Focal Point Moderator
Information Builders


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5