How to: |
You can provide update capabilities directly from your report by linking it to a WebFOCUS Maintain procedure. The link is a URL for the WebFOCUS Servlet and includes the IBIF_cmd command with the MNTCON RUN or MNTCON EX syntax to invoke an existing WebFOCUS Maintain form procedure. The link can pass control to a Maintain form, or run a batch mode Maintain procedure that does not display a user interface.
TYPE=type, [subtype, ] URL=/ibi_apps/WFServlet? IBIF_cmd='MNTCON {RUN|EX} procname' IBIS_passthru='on' IBIS_connect='on' [(parameters...)], $
where:
The following report allows you to update the unit price for a product directly from the report output by linking the report to the appropriate Maintain procedure.
The report request is:
TABLE FILE GGPRODS
PRINT PRODUCT_DESCRIPTION VENDOR_CODE VENDOR_NAME UNIT_PRICE
BY PRODUCT_ID
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, $
TYPE=DATA, COLUMN=N1,
URL=/ibi_apps/WFServlet?(PRODUCT_ID=N1 IBIF_cmd='MNTCON RUN GGUPD1'
IBIS_passthru=\
'on' IBIS_connect='on'), $
ENDSTYLE
ENDThe WebFOCUS Maintain procedure (ggupd1) is:
MAINTAIN FILE ggprods
module import(mntuws FOCCOMP)
$$Declarations
Declare pcode/a4;
Case Top
compute timechk/a0=HHMMSS();
document.referer='/ibi_apps/WFServlet?IBIF_ex=ggprod&IBIS_connect
=on'||
'&timechk='|timechk;
compute pcode = IWC.getAppCGIValue("PRODUCT_ID");
Infer ggprods.prods01.product_id into ggstk1;
Reposition PRODUCT_ID
Stack clear ggstk1 ;
For all next ggprods.prods01.product_id into ggstk1
where product_id eq pcode;
Winform Show Form1;
EndCase
Case Updte1
for all Update ggprods.prods01.unit_price from ggstk1(1) ;
EndCase
ENDNote: This is an interactive form to display data and is created in Developer Studio.
The report is:

When you click a Product Code, the Maintain procedure ggupd1 is invoked, which uses the IWC.getAppCGIValue function to retrieve the correct value.
Form 1 in the WebFOCUS Maintain procedure ggupd1 opens and you can update the unit price for that product:

| WebFOCUS |