Focal Point
[SOLVED] Redirect from one report to another

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

December 11, 2008, 04:40 PM
Donald
[SOLVED] Redirect from one report to another
I are trying to develop a report to update a database.There are two fexes.

Main report contains all the input fields, so the user can enter information and click update. When the update button is clicked, all the input field information is retrieved through javascript code and stored into the hidden controls and then passed as parameters to a procedure which processes and executes the modify statements. After finishing all the steps, we would like a method to redirect back to the main report. I am using a workaround by having a "go back" button. But is there a way to automatically go back after update instead.

This is the fex that does the update.

MODIFY FILE NEO_FORECAST_ADJUSTMENT
FIXFORM FROM HFRCST
MATCH COMPANY CUSTOMER
ON MATCH UPDATE SALES_FORECAST_MO1 SALES_FORECAST_MO2 SALES_FORECAST_MO3 SALES_FORECAST_MO4 SALES_FORECAST_MO5 SALES_FORECAST_MO6 SALES_FORECAST_MO7 SALES_FORECAST_MO8 SALES_FORECAST_MO9 SALES_FORECAST_MO10 SALES_FORECAST_MO11 SALES_FORECAST_MO12 LAST_CHANGE_DATE LAST_CHANGE_USER
DATA ON HFRCST
END
-RUN
-EXIT
DEFINE FILE NEO_FORECAST_ADJUSTMENT
 BUTTON/A100='click here';
END
TABLE FILE NEO_FORECAST_ADJUSTMENT
PRINT BUTTON

END
-*FOCEXURL
-*EXEC forecast_worksheet_kiran

-RUN
-HTMLFORM BEGIN
<html>
<head>
<META HTTP-EQUIV="REFRESH" URL="http://uns40-114/ibi_apps/WFServlet?IBIF_ex=forecast_worksheet_kiran">
</head>
<body>
Updated Sales Forecast successfully, click here to go back to the report.
</body>

</html>
-HTMLFORM END
  

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


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
December 11, 2008, 06:19 PM
Darin Lee
couldn't you just have an "onLoad" action on your HTMLFORM that automatically executes the specified URL? That seems easiest or maybe I'm making it too simple.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
December 12, 2008, 06:58 AM
Anoop
Just try this, it will update and return back to the called fex automatically after the update is done

MODIFY FILE NEO_FORECAST_ADJUSTMENT
FIXFORM FROM HFRCST
MATCH COMPANY CUSTOMER
ON MATCH UPDATE SALES_FORECAST_MO1 SALES_FORECAST_MO2 SALES_FORECAST_MO3 SALES_FORECAST_MO4 SALES_FORECAST_MO5 SALES_FORECAST_MO6 SALES_FORECAST_MO7 SALES_FORECAST_MO8 SALES_FORECAST_MO9 SALES_FORECAST_MO10 SALES_FORECAST_MO11 SALES_FORECAST_MO12 LAST_CHANGE_DATE LAST_CHANGE_USER
DATA ON HFRCST
END
-RUN
-EXIT
DEFINE FILE NEO_FORECAST_ADJUSTMENT
BUTTON/A100='click here';
END
TABLE FILE NEO_FORECAST_ADJUSTMENT
PRINT BUTTON

END
-*FOCEXURL
-*EXEC forecast_worksheet_kiran

-RUN
-HTMLFORM BEGIN











-HTMLFORM END


WebFOCUS 7.0.4
Windows XP
HTML
PDF
EXCEL
December 12, 2008, 07:05 AM
Anoop
oops ..

MODIFY FILE NEO_FORECAST_ADJUSTMENT
FIXFORM FROM HFRCST
MATCH COMPANY CUSTOMER
ON MATCH UPDATE SALES_FORECAST_MO1 SALES_FORECAST_MO2 SALES_FORECAST_MO3 SALES_FORECAST_MO4 SALES_FORECAST_MO5 SALES_FORECAST_MO6 SALES_FORECAST_MO7 SALES_FORECAST_MO8 SALES_FORECAST_MO9 SALES_FORECAST_MO10 SALES_FORECAST_MO11 SALES_FORECAST_MO12 LAST_CHANGE_DATE LAST_CHANGE_USER
DATA ON HFRCST
END
-RUN
-EXIT
DEFINE FILE NEO_FORECAST_ADJUSTMENT
BUTTON/A100='click here';
END
TABLE FILE NEO_FORECAST_ADJUSTMENT
PRINT BUTTON

END
-*FOCEXURL
-*EXEC forecast_worksheet_kiran

-RUN
-HTMLFORM BEGIN











-HTMLFORM END


WebFOCUS 7.0.4
Windows XP
HTML
PDF
EXCEL
December 12, 2008, 07:08 AM
Tom Flynn
Put your HTML between the code tags
 

the RED </> at the far right of the toolbar, above.
 



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
December 12, 2008, 07:11 AM
Anoop
MODIFY FILE NEO_FORECAST_ADJUSTMENT
FIXFORM FROM HFRCST
MATCH COMPANY CUSTOMER
ON MATCH UPDATE SALES_FORECAST_MO1 SALES_FORECAST_MO2 SALES_FORECAST_MO3 SALES_FORECAST_MO4 SALES_FORECAST_MO5 SALES_FORECAST_MO6 SALES_FORECAST_MO7 SALES_FORECAST_MO8 SALES_FORECAST_MO9 SALES_FORECAST_MO10 SALES_FORECAST_MO11 SALES_FORECAST_MO12 LAST_CHANGE_DATE LAST_CHANGE_USER
DATA ON HFRCST
END
-RUN
-EXIT
DEFINE FILE NEO_FORECAST_ADJUSTMENT
BUTTON/A100='click <a href="http://uns40-114/ibi_apps/WFServlet?IBIF_ex=forecast_worksheet_kiran">here</a>';
END
TABLE FILE NEO_FORECAST_ADJUSTMENT
PRINT BUTTON

END
-*FOCEXURL
-*EXEC forecast_worksheet_kiran

-RUN
-HTMLFORM BEGIN
<html>
<head>
<META HTTP-EQUIV="REFRESH" URL="http://uns40-114/ibi_apps/WFServlet?IBIF_ex=forecast_worksheet_kiran">
</head>
<body onload="javascript:form1.submit();">
<form name=form1 method=post action="/ibi_apps/WFServlet" target=_self>
<input type=hidden name=IBIF_ex value=forecast_worksheet_kiran>
</form>
</body>

</html>
-HTMLFORM END


WebFOCUS 7.0.4
Windows XP
HTML
PDF
EXCEL
December 12, 2008, 01:13 PM
Donald
Thanks ALOOP your code worked perfectly. TexasStingray, we do not have Maintain.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
December 13, 2008, 01:35 PM
susannah
not sure why there's an EXIT in the middle of that fex, or how you would get around it..
but i just do this
MODIFY FILE whatever
....
END
-RUN
EX app/forecast_worksheet_kiran
if its in the same domain
or
EX {domainname}/app/forecast_worksheet_kiran
if it not in the same domain
or
-MRNOEDIT EX {appname}/forecast_worksheet_kiran.fex
if its on the backend
Works for me..
no user involvement..it just runs as soon as the modify is done.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
December 15, 2008, 03:29 AM
Tony A
Why not have a single fex?

-DEFAULT &RunType = ':Report'
-GOTO &RunType;
-:Report
DEFINE FILE .....
END
TABLE FILE ......
PRINT COMPUTE ...
ON TABLE SAVE AS MYHTML FORMAT HTMTABLE
style etc ....
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title></title>
</head>
<body>
<form>
<input type="hidden" name="RunType" value=":Update' />
!IBI.FIL.MYHTML;
</form>
</body>
</html>
-HTMLFORM END
-EXIT
-:Update
MODIFY FILE ......
FREEFORM field1 field2 ......
MATCH field1
  ON MATCH CONTINUE
  ON NOMATCH REJECT
MATCH field2
  ON MATCH CONTINUE
  ON NOMATCH REJECT
DATA
-* build your parms from your data entry form here
END
-RUN
-GOTO :Report;

Basically, after the update section redirect your report to the top of the fex to display your HTML form. Advantage is that the two component parts of the entire process are contained in one location rather than two or more - possibly reducing maintenance overheads. Use the power of dialogue manager!

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 
December 16, 2008, 01:18 AM
dhagen
If you execute your update using an AJAX call, then you would not have to go back because the page contents would not change. When the call finishes successfully, then you can just show an alert box to let the user know what happened ... if that is required.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott