Focal Point
[SOLVED] drill down - execute two procedures

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

December 06, 2013, 09:19 AM
Piter
[SOLVED] drill down - execute two procedures
Dear all,

May be you can advise me how to update 2 frames (run 2 focexecs) on drill down? I have 3 graph on page and on selecting some field in first, like to update 2 rest graphs.

thank yo in advance!

This message has been edited. Last edited by: <Kathryn Henning>,


Wf7704/WF8,Win64/32
December 06, 2013, 10:23 AM
Ian Dalton
Yo could try the following technique....ie. in this case drill-down to xxxxx if they select HTML format, or drill-down to yyyyy if they select Excel format Xpass
TYPE=DATA,
DRILLMENUITEM='HTML',
FOCEXEC=xxxxx(SERV_LINE=N2 \
TEAM_NAME=N3 \
TBL_REQUEST='&TBL_REQUEST' \
KPI_NUM=N8 \
OUTPUT='HTML' ),
DRILLMENUITEM='Excel',
FOCEXEC=yyyyy(SERV_LINE=N2 \
TEAM_NAME=N3 \
TBL_REQUEST='&TBL_REQUEST' \
KPI_NUM=N8 \
OUTPUT='EXL2K' ),


_______________________
*** WebFOCUS 8.1.05M ***
December 06, 2013, 10:29 AM
Piter
Thank you Ian, I know and use in other places this multi-drill technique.

But I need on press of value to update both graphs - it's a bit other thing. With one click.

is it impossible?


Wf7704/WF8,Win64/32
December 06, 2013, 11:17 AM
njsden
The concept of a drill-down involves well, "drilling" from a high-level or summarized data representation "down" to the detail rows that make up that particular data piece and by design, you can have only one single target for the action taken.

To try and achieve what you want it may require using a custom JavaScript function as the target of your drill-down and within it create the calls to each graph procedure targeting each of your iframes.

Something like the following (very high-level and simplistic):

1) Create the drilldown call to a custom JS function passing whatever parameters make sense:

...
TYPE=DATA, COLUMN=N5, JAVASCRIPT=runGraphs(N5), $
...


2) Define your JS function either in a file you can reference via JSURL or perhaps embedded within HTMLFORM. You'll have to play with that.

// This is *not* valid JS code ... just a concept!
function runGraphs(value) {
   var iframe1 = document.getElementById('iframe1');  // iframe for Graph 1
   var iframe2 = document.getElementById('iframe2');  // iframe for Graph 2

   if(iframe1) {
      // Build URL to call WF graph procedure passing "value" as a valid parameter expected by the .fex
      // URL must represent a valid WFServlet call depending on where the .fex is located (Server or MRE)

      var graphURL1 = '/ibi_apps/WFServlet?IBIF_ex=mygraph1.fex&PARAM1=' || value;
      // "Run" request in iframe1
      iframe1.src = graphURL1;
   }

   if(iframe2) {
      // Build URL to call WF graph procedure passing "value" as a valid parameter expected by the .fex
      // URL must represent a valid WFServlet call depending on where the .fex is located (Server or MRE)

      var graphURL2 = '/ibi_apps/WFServlet?IBIF_ex=mygraph2.fex&PARAM1=' || value;
      // "Run" request in iframe2
      iframe2.src = graphURL2;
   }

}



As I said, that's very simplistic but it's how I would probably start at playing when implementing a similar solution. Hopefully the concept makes sense and you can follow it to solve your need.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
December 06, 2013, 01:52 PM
Doug
You could DRILL DOWN to a single fex which, in turn, -INCLUDEs two, or more, fexes. That would, essentially, "run 2 focexecs from a single drill down"...
December 06, 2013, 02:06 PM
Piter
Doug, let's say I went to FEX1 (what means I updating graph_1 in iframe_1). How to ask from this fex to update graph_2 in iframe2 on same page? Possible? With what kind of INCLUDE?

It looks solution form njsden is the right one and it is not possible to do just by WF.


Wf7704/WF8,Win64/32
December 06, 2013, 02:16 PM
njsden
That's true Doug, but the output of such procedure(s) will still be constrained to a single target window or iframe.

Having 2 separate iframes loading independent results as Piter wants upon clicking a drill-down link would require 2 individual requests to be triggered concurrently which is not supported by the current implementation of FOCEXEC for drilldowns, hence the need for JavaScript.

Perhaps there is a more straightforward way to accomplish the very same ...

Piter, do you really need your graphs running in individual iframes? How about having them both in a single HTML document separated in individual DIV's which you can style at will? That way you can use a single procedure as Doug suggests, within which you'd produced both graphs holding them in HTMTABLE format and then putting them together via -HTMLFORM.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
December 06, 2013, 03:34 PM
Piter
njsden, sorry for saying that, but I am too "dummy" - I have tried several times, but was not able to put different graphs to different DIV's. This can be ideal solution for me, but I have not find a way to do it... Is there any simple example?


Wf7704/WF8,Win64/32
December 06, 2013, 04:10 PM
njsden
Here's a very basic example using the CAR table:

-DEFAULT &P_COUNTRY='ENGLAND';

-* Graph 1
GRAPH FILE CAR
-* Created by Advanced Graph Assistant
SUM CAR.BODY.DEALER_COST
CAR.BODY.RETAIL_COST
BY CAR.COMP.CAR
WHERE CAR.ORIGIN.COUNTRY EQ '&P_COUNTRY';
ON GRAPH HOLD AS HGRAPH1 FORMAT HTMTABLE
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setTextString(getTitle(),"Sales in &P_COUNTRY");
setDisplay(getTitle(),true);
ENDSTYLE
END
-RUN

-* Graph 2
GRAPH FILE CAR
-* Created by Advanced Graph Assistant
SUM CAR.BODY.SALES
BY CAR.COMP.CAR
WHERE CAR.ORIGIN.COUNTRY EQ '&P_COUNTRY';
ON GRAPH HOLD AS HGRAPH2 FORMAT HTMTABLE
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HAXIS 770
ON GRAPH SET VAXIS 405
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 1
ON GRAPH SET GRXAXIS 0
ON GRAPH SET GRAPHSTYLE *
setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
setDepthRadius(5); 
setPieDepth(10);
setPieFeelerTextDisplay(1); 
setTransparentBorderColor(getChartBackground(),true); 
setPlace(true);
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
<!DOCTYPE html>
<html lang="en"><head><title>Sales Charts</title>
<style type="text/css">
#pnGraph1 { float: left; }
</style>
</head>
<body>
<div id='pnGraph1'>!IBI.FIL.HGRAPH1;</div>
<div id='pnGraph2'>!IBI.FIL.HGRAPH2;</div>
</body>
</html>
-HTMLFORM END



Of course you can make the charts much sexier using appropriate styling, along with some CSS to make sure your DIV elements get positioned as you need them.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
December 06, 2013, 05:51 PM
Piter
As usual - nice example, big Thank you!


Wf7704/WF8,Win64/32