Jump to content

call webfocus procedure from iframe src with parameter


Go to solution Solved by David Beagan ,

Recommended Posts

Hello everyone.
Does anyone know what this code is missing to be able to correctly call the procedure from the src of the iframe, passing the selection in the drop-down list as a parameter.
 Thank you so much.

<!DOCTYPE html>
<html>
<head>
  <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>

  <script>
    $(document).ready(function() {
      // Función para cargar dinámicamente las categorías (opcional)

      $("#paramselector").change(function() {
        var param1 = $(this).val();
        var param2 = "Computers";
        var iframe = document.getElementById("report");
     // iframe.src = "/ibi_apps/run/IBFS/WFC/Repository/Curso_Miguel/PRUEBAS/rp_retail_ingresos_por_categoria.fex&PRODUCT_CATEGORY=" + param2;
        iframe.src = "/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_RUN&BIP_folder=IBFS:/WFC/Repository/Curso_Miguel/PRUEBAS&BIP_item=rp_retail_ingresos_por_categoria.fex&PRODUCT_CATEGORY=" + param1;
      });
    });
  </script>
</head>
<body>
  <div id="content">
    <div id="items" >
      <h1>3. Elige parámetro</h1>
      <div style="width:100%;">
        <select style="width:100%;" id="paramselector">
          <option value="Computers">Computers</option>
          <option value="Accessories">Accesories</option>
        </select>
        <iframe id="report" style="width:1000px; height:300px; border: 1px solid black;"></iframe>
      </div>
      <br/>
    </div>
  </div>
</body>
</html>

Link to comment
Share on other sites

Hi David,

What does not work is sending param1 to the .FEX procedure, which is always executed completely, without applying the filter that I am trying to inform with param1

This is fex code of rp_retail_ingresos_por_categoria.fex

-SET &ECHO=ALL;
ENGINE INT CACHE SET ON
SET PAGE-NUM=NOLEAD
SET SQUEEZE=ON
-DEFAULTH &WF_HTMLENCODE=ON;
SET HTMLENCODE=&WF_HTMLENCODE

SET HTMLCSS=ON
-DEFAULTH &WF_EMPTYREPORT=ON;
SET EMPTYREPORT=&WF_EMPTYREPORT

SET EMBEDHEADING=ON
SET GRAPHDEFAULT=OFF
SET ARVERSION=2

-DEFAULTS &PRODUCT_CATEGOR=_FOC_NULL;
-DEFAULTH &WF_SUMMARY='Summary';
-DEFAULTH &WF_TITLE='WebFOCUS Report';
TABLE FILE ibisamp/wf_retail/wf_retail_lite
SUM WF_RETAIL_LITE.WF_RETAIL_SALES.REVENUE_US
BY WF_RETAIL_LITE.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY
BY WF_RETAIL_LITE.WF_RETAIL_PRODUCT.PRODUCT_SUBCATEG
WHERE WF_RETAIL_LITE.WF_RETAIL_PRODUCT.PRODUCT_CATEGORY EQ &PRODUCT_CATEGOR.QUOTEDSTRING;
ON TABLE PCHOLD FORMAT HTML
ON TABLE NOTOTAL
ON TABLE SET VZERO OFF
ON TABLE SET BYDISPLAY BY
ON TABLE SET POPUPDESC ON
ON TABLE SET STYLE *
INCLUDE=IBFS:/WFC/Global/Themes/Standard/Default/theme.sty,$
TYPE=REPORT, TITLETEXT='Informe1', SUMMARY=&WF_SUMMARY.QUOTEDSTRING, ARREPORTSIZE=DIMENSION, ARFILTER_TARGET='*', CHART-COLOR-MEASURES=ON, ARGRAPHENGINE=JSCHART, $
ENDSTYLE
END

call iframe.PNG

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...