Focal Point
[SOLVED] Setting browser properties when drill down from a graph

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

October 22, 2009, 11:14 PM
CT
[SOLVED] Setting browser properties when drill down from a graph
I have a dashboard like report created in HTML composer tool in DevStudio. The dashboard report has a pie graph with a drill drown feature. Clicking on a pie slice opens a popup browser with a tabular report. I need to control the properties of the browser window like hide the back button, url, menu items, size of the window etc. I have been searching the Focal Point for any applicable solutions.
The closest I could get is to add the code to .htm file to open a window with defined properties and refernce the window name as aTARGET in the graph file.

 <script>
my_window = window.open('', 'newwin',
 'resizable=yes, scrollbars=no, toolbars=no, location=no, directories=no, status=no, menubar=no, copyhistory=no');
</script>
 


In the graph file refer to the created window.
TYPE=DATA, COLUMN=N2,FOCEXEC=agasum(country=N1), TARGET='newwin', $


But this creates a blank browser up front before the drilling is done. is there a way to create the window when the user actually tries to drill.
Thanks for your help.

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


7.6.9, XP
October 23, 2009, 04:23 AM
Tony A
CT,

Look into using a JAVASCRIPT call instead of the FOCEXEC call in your style syntax, and make the script the function that you call. You will need to include script within a file accessible by your resultant HTML file.

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 
October 23, 2009, 04:43 AM
<JG>
Almost there.

The drilldown needs to call the javascript function which re-writes and submits the request

 
GRAPH FILE CAR
SUM DEALER_COST
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH BAR
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
ON GRAPH SET VZERO ON
ON GRAPH SET GRID ON
ON GRAPH SET STYLE *
TYPE=REPORT, GRID=OFF, FONT='TIMES NEW ROMAN', SIZE=10, BACKCOLOR='NONE',
STYLE=NORMAL,$
TYPE=DATA, ACROSSCOLUMN=N1, JAVASCRIPT=runReport(COUNTRY),$
ENDSTYLE
ON GRAPH HOLD AS GRP1 FORMAT HTMTABLE
END
-HTMLFORM BEGIN
<html>
<SCRIPT LANGUAGE="JavaScript">
function runReport(COUNTRY) {
 var randomNumber=Math.floor(Math.random()*10000001);
 var uri = '/ibi_apps/WFServlet?IBIF_ex=carinst';
     uri += '%26COUNTRY=' + COUNTRY   ;
     uri += '%26RANDOM=' + randomNumber         ;
 window.open(unescape(uri),'','menubar=no,toolbar=no,status=no,location=no,width=200,height=200,resizable=no,scrollbars=no,left=200,top=200');
}
</script>
<body>
!IBI.FIL.GRP1;
</body>
</html>
-HTMLFORM END
 

October 23, 2009, 03:19 PM
CT
JG,
Thanks for your solution. I tried with my code and have a problem.

Below is my graph file. I am creating a computed field for the BY in order to sort the legend items. But I can not use it as a parameter for the java function since I can not use it for WHERE in my target report. The TARGET for my graph has three parameters, one of them is a NOPRINT field and other two are amper variables.
This works fine and brings up the standard browser.

-* File db-cabin.fex
-SET &name = 'CABINNAME';
-SET &lblText = 'Cabin';

TABLE FILE HDBMAIN
SUM
REQHOSTFLIGHTS AS 'HOSTFLIGHTS'
BY CONTRACTNAME
BY TOTAL HIGHEST 10 REQHOSTFLIGHTS NOPRINT
BY CABINNAME
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS DBCABIN1
END

TABLE FILE DBCABIN1
SUM
     HOSTFLIGHTS
    COMPUTE C_HOSTFLIGHTS/A20 = FTOA(PCT.HOSTFLIGHTS, '(D15)', 'A20');
   COMPUTE C_SORT/A60 = C_HOSTFLIGHTS || '% - ' || MAX.CABINNAME;
BY CONTRACTNAME
BY TOTAL HIGHEST 10 HOSTFLIGHTS NOPRINT
BY CABINNAME
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS DBCABIN2
END

GRAPH FILE DBCABIN2
SUM HOSTFLIGHTS
MAX.CABINNAME AS 'CABINNAME' NOPRINT
BY HIGHEST C_SORT
ON GRAPH PCHOLD FORMAT PNG

ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 490
ON GRAPH SET VAXIS 350
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
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/PrismSouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(0);
setReverseSeries(0);
-*setLegendPosition(3);
setLegendAutomatic(true);
setLegendPosition(3);
setDisplay(getPieLabel(),false);
setPlace(false);
setPlaceResize(getPieSliceLabel(),0);
setFontName(getPieSliceLabel(),"Arial");
setFontName(getLegendText(),"Arial");
setFontName(getSubtitle(),"Arial");
setTextString(getTitle(),"");
setTextString(getSubtitle(),"Cabin");
setDisplay(getSubtitle(),true);
setFontSizeAbsolute(getSubtitle(),true);
setFontSizeInPoints(getSubtitle(),12);
setFontStyle(getSubtitle(),2);
setPlaceResize(getLegendText(),0);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),6);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),6);
setFillColor(getChartBackground(),new Color(255,255,255));
setTransparentBorderColor(getChartBackground(),true);
setPieDepth(0);
setPieTilt(0);
setOtherPieLabelDisplay(0);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),28);
setFontSizeAbsolute(getLegendText(), true);
setFontSizeInPoints(getLegendText(), 8);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setLegendPosition(-1);
setLegendAutomatic(false);
setRect(getLegendArea(),new Rectangle(-16000.0,-1000.0,3000.0,8000.0));
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=DATA, COLUMN=N2, FOCEXEC=db-contract-detail(val = N3 name = '&name.EVAL' lblText = '&lblText.EVAL'), TARGET='report1', $
ENDSTYLE
END
-RUN

  


With the Javascript function to customize the browser, I made the amper variables as DEFINE fields and included in TABLE FILE as NOPRINT fields. The graph part comes up and when I mouse over the slices I see JAVASCRIPT:runReport('','',''). For some reason it's not getting the parameter values. Is it because they are NOPRINT fields? But I don't know I have any other way. As you can tell, I am not very familiar with Java script syntax.

 
-* File db-cabin.fex
-SET &name = 'CABINNAME';
-SET &lblText = 'Cabin';

TABLE FILE HDBMAIN
SUM
REQHOSTFLIGHTS AS 'HOSTFLIGHTS'
  BY CONTRACTNAME
BY TOTAL HIGHEST 10 REQHOSTFLIGHTS NOPRINT
BY CABINNAME
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS DBCABIN1
END

DEFINE FILE DBCABIN1
name/A10 = 'CABINNAME';
lblText/A10 = 'Cabin';
END

TABLE FILE DBCABIN1
SUM
     HOSTFLIGHTS
    COMPUTE C_HOSTFLIGHTS/A20 = FTOA(PCT.HOSTFLIGHTS, '(D15)', 'A20');
   COMPUTE C_SORT/A60 = C_HOSTFLIGHTS || '% - ' || MAX.CABINNAME;
MAX.name AS 'name' 
MAX.lblText AS 'lblText' 
BY CONTRACTNAME
BY TOTAL HIGHEST 10 HOSTFLIGHTS NOPRINT
BY CABINNAME
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS DBCABIN2
END

GRAPH FILE DBCABIN2
SUM HOSTFLIGHTS
BY HIGHEST C_SORT
ON GRAPH PCHOLD FORMAT PNG
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET VZERO OFF
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET HAXIS 490
ON GRAPH SET VAXIS 350
ON GRAPH SET UNITS PIXELS
ON GRAPH SET LOOKGRAPH PIESINGL
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/PrismSouthWestern.txt");
setReportParsingErrors(false);
setSelectionEnableMove(false);
setPieFeelerTextDisplay(0);
setReverseSeries(0);
-*setLegendPosition(3);
setLegendAutomatic(true);
setLegendPosition(3);
setDisplay(getPieLabel(),false);
setPlace(false);
setPlaceResize(getPieSliceLabel(),0);
setFontName(getPieSliceLabel(),"Arial");
setFontName(getLegendText(),"Arial");
setFontName(getSubtitle(),"Arial");
setTextString(getTitle(),"");
setTextString(getSubtitle(),"Cabin");
setDisplay(getSubtitle(),true);
setFontSizeAbsolute(getSubtitle(),true);
setFontSizeInPoints(getSubtitle(),12);
setFontStyle(getSubtitle(),2);
setPlaceResize(getLegendText(),0);
setFontSizeAbsolute(getLegendText(),true);
setFontSizeInPoints(getLegendText(),6);
setFontSizeAbsolute(getPieSliceLabel(),true);
setFontSizeInPoints(getPieSliceLabel(),6);
setFillColor(getChartBackground(),new Color(255,255,255));
setTransparentBorderColor(getChartBackground(),true);
setPieDepth(0);
setPieTilt(0);
setOtherPieLabelDisplay(0);
setPieLabelDisplay(0);
setTextFormatPreset(getPieSliceLabel(),28);
setFontSizeAbsolute(getLegendText(), true);
setFontSizeInPoints(getLegendText(), 8);
setTransparentBorderColor(getSeries(0),true);
setTransparentBorderColor(getSeries(1),true);
setTransparentBorderColor(getSeries(2),true);
setTransparentBorderColor(getSeries(3),true);
setTransparentBorderColor(getSeries(4),true);
setLegendPosition(-1);
setLegendAutomatic(false);
setRect(getLegendArea(),new Rectangle(-16000.0,-1000.0,3000.0,8000.0));
setPlace(true);
ENDSTYLE
ON GRAPH SET STYLE *
TYPE=DATA, COLUMN=N2, JAVASCRIPT=runReport(CABINNAME name lblText), $
ENDSTYLE
ON GRAPH HOLD AS GRP1 FORMAT HTMTABLE
END
-HTMLFORM BEGIN
<html>
<SCRIPT LANGUAGE="JavaScript">
function runReport(COUNTRY) {
 var uri = '/ibi_apps/WFServlet?IBIF_ex=db-contract-detail';
  uri += '%26CABINNAME=' + CABINNAME   ;
     uri += '%26name=' + name   ;
     uri += '%26lblText=' + lblText         ;
 window.open(unescape(uri),'','menubar=no,toolbar=no,status=no,location=no,width=200,height=200,resizable=yes,scrollbars=no,left=200,top=200, titlebar=no);
}
</script>
<body>
!IBI.FIL.GRP1;
</body>
</html>
-HTMLFORM END

Again, thanks a lot for your help.


7.6.9, XP
October 25, 2009, 10:45 PM
CT
I got it working. I was just making the java function complex by adding amper variables .
-HTMLFORM BEGIN
<html>
<SCRIPT LANGUAGE="JavaScript">
function runReport(N3) {
 var uri = '/ibi_apps/WFServlet?IBIF_ex=dbcontractdetail';
  uri += '%26val=' + N3   ;
     uri += '%26name=CABINNAME ';
     uri += '%26lblText=Cabin ' ;
 window.open(unescape(uri),'','menubar=no,toolbar=no,status=no,location=no,width=200,height=200,resizable=yes,scrollbars=no,left=200,top=200, titlebar=no, fullscreen=no');
}
</script>
<body>
!IBI.FIL.GRP1;
</body>
</html>
-HTMLFORM END
  


I just have one more question. Is it possible to not show the query string in the title bar and instead show a string like 'Top Markets'. I think I can get rid of the title bar itself by making it fullscreen, but that may not be the solution.
Thanks for your help!


7.6.9, XP