Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Need for setting size of target pop-up window of drill-down link:

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Need for setting size of target pop-up window of drill-down link:
 Login/Join
 
Virtuoso
posted
Hey all,

So, my project lead has asked me to look into the possibility of being able to set the size of the new window that pops up after a user clicks on a drill-down link within a report (using target = _blank). I know pop-ups are frowned upon across the industry, but my project lead desires such for some bar graphs that can be drilled to (I originally had them opening up in the same window/panel). He wants them in their own window, but he doesn't care for them opening up in a new tab of whatever browser the user is currently using due to if the user has a large screen resolution the graphs being rather big at first. Obviously the user could simply drag the new tab with the graph into its own window and resize it to fit their desires, but, alas, that is not what is wanted.

I know about JavaScript's window.open(URL,name,specs,replace) function and params, but can it be used in conjunction with drills created within WebFocus drill-down syntax in place? Such as:

TYPE=DATA,
     COLUMN=N6,
     FOCEXEC=IBFS:/WFC/Repository/domain/subFolder1/subFolder2/Graphs/graph.fex( \
     FIELD1=N1 \
     FIELD2=&DSACCTNO.QUOTEDSTRING \
     FIELD3=&WEEKENDING.QUOTEDSTRING \
     ),
          TARGET='_blank',
$


Or is there a way to set the size of a new window for a drill-down in WebFocus, DM, etc. somehow?

Thanks for any insights in advance. Appreciate those that are dedicated to helping in these forums.

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


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
http://forums.informationbuild...351028331#3351028331

http://forums.informationbuild...967065426#3967065426


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Virtuoso
posted Hide Post
Tom,

Thanks for the links. I don't think the links were too helpful due to them assuming you have access to the HTML.

All,

My dilemma is that I am trying to either inject Js into the generated HTML that the report produces, or finding a provided way to set the window size within the report request style drill-down code (or where ever).

I took a look at the generated HTML and all it does is produce an anchor tag and append the TARGET style spec as an attribute of such:

{'type':1,'byindex':-1,'column':3,'attrib':{'bold':false,'italic':false,'underline':false,'size':9,'color':'#424649','backcolor':['#FFFFFF','#EBEBF0'],'font':'TREBUCHET MS',
'href':'<a href="/ibi_apps/WFServlet.ibfs?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&IBIWF_msgviewer=OFF&IBIAPP_app=appdir1%20appdir2%20appdir3%20appdir4%20appdir5%20appdir6&&IBIMR_drill=IBFS,RUNFEX,IBIF_ex,true&IBIF_ex=IBFS:/WFC/Repository/domain/subFolder1/subFolder2/Graphs/graph.fex&CLICKED_ON=&SRPDCASHIERNAME=$COL$0$&DSACCTNO=_FOC_NULL&WEEKENDING=20150829" TARGET="_blank">'}}


So, I thought I could do one of the following possibly:

TYPE=DATA,
     COLUMN=N4,
     FOCEXEC=IBFS:/WFC/Repository/domain/subFolder1/subFolder2/Graphs/graph.fex( \
     SRPDCASHIERNAME=N1 \
     DSACCTNO=&DSACCTNO.QUOTEDSTRING \
     WEEKENDING=&WEEKENDING.QUOTEDSTRING \
     ),
	 TARGET='_blank';
-*   TARGET='window.open("IBFS:/WFC/Repository/domain/subFolder1/subFolder2/Graphs/graph.fex", "_blank", "width=200, height=100")',
-*	 ONCLICK='window.open(this.getAttribute('href'), "_blank", "width=200, height=100")',
$


But no dice. I get the following generated HTML:

{'type':1,'byindex':-1,'column':3,'attrib':{'bold':false,'italic':false,'underline':false,'size':9,'color':'#424649','backcolor':['#FFFFFF','#EBEBF0'],'font':'TREBUCHET MS',
'href':'<a href="/ibi_apps/WFServlet.ibfs?IBIF_webapp=/ibi_apps&IBIC_server=EDASERVE&IBIWF_msgviewer=OFF&IBIAPP_app=appdir1%20appdir2%20appdir3%20appdir4%20appdir5%20appdir6&&IBIMR_drill=IBFS,RUNFEX,IBIF_ex,true&IBIF_ex=IBFS:/WFC/Repository/domain/subFolder1/subFolder2/Graphs/graph.fex&CLICKED_ON=&SRPDCASHIERNAME=$COL$0$&DSACCTNO=_FOC_NULL&WEEKENDING=20150829" TARGET="window.open(\"I">'}}


Or something similar (Even if I try to use a &var for the target due to it only allowing for 15 chars). I even tried adding escape characters for the nested quotes but that didn't work either and gets cut off too. It either runs saying no records, or runs but opens the drill in a new tab of the browser as if the target were _blank.

UGH!! There's got to be a way to set the pop-up window size of a drill down!

Can anyone else think of a way this could be done, or should I try for an NFR? haha

If only the target attribute was set up to allow for a length of more than 15 characters, or there was a way to modify the generated report HTML somehow...


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
...I know about JavaScript's window.open(URL,name,specs,replace) function and params, but can it be used in conjunction with drills created within WebFocus drill-down syntax in place? Such as:TYPE=DATA,
COLUMN=N6,
FOCEXEC=IBFS:/WFC/Repository/domain/subFolder1/subFolder2/Graphs/graph.fex( \...

Yes.

Here is an example:

Main Report:
-* File mainreport.fex
-*
-* Environment setups.
-*
APP PREPENDPATH IBISAMP
-*
-* Create Main Report.
-*
TABLE FILE CAR
"Main Report"
SUM SALES/D9C
BY COUNTRY
ON TABLE HOLD AS HLDMNRPT FORMAT HTMTABLE
ON TABLE SET PAGE NOPAGE
ON TABLE SET STYLESHEET *
TYPE=DATA, COLUMN=COUNTRY, JAVASCRIPT=fn_drilldown(COUNTRY), COLOR=BLUE,$
 INCLUDE = ENInformationBuilders_Light1, $
 TYPE=TITLE,  JUSTIFY=CENTER,$
ENDSTYLE
END
-RUN
-*
-* Report Presentation.
-*
-HTMLFORM BEGIN NOEVAL
<!DOCTYPE html>
<head>
<TITLE>Main Report</TITLE>
<script language='javascript'>
 //
 // Function: fn_drilldown
 // Purpose : Call Drill Down Report.
 //
  function fn_drilldown(country) {
   document.hiddenRunForm.COUNTRY.value = country;
   // Set window properties.
   var WProps = new String("location=no,toolbar=no,directories=no");
       WProps += ",scrollbars=yes,menubar=no";
                  WProps += ",status=no,resizable=yes,top=20,left=10,width=300, height=300";
   // Create a random number.
   var rand = 0;
       rand = Math.round(Math.random() * 100000);
   // Set the target/action of the Run WF Report Form.
   document.hiddenRunForm.target = "drilldown" + rand.toString();
   document.hiddenRunForm.action = '/ibi_apps/WFServlet?IBIAPP_app=mashups&IBIF_ex=drilldownreport.fex&RND=' +
                                   rand.toString();
   // Open the pop up window with a blank page.
   rptWindow = window.open("", document.hiddenRunForm.target, WProps);
   // Load the WF report to the new window.
   document.hiddenRunForm.submit();
  }
</SCRIPT>
</HEAD>
<BODY>
!IBI.FIL.HLDMNRPT;
-*
-* Hidden Form, submitted to WebFOCUS.
-*
<form name="hiddenRunForm" id="hiddenRunForm" style="visibility:hidden;"
method="post" target="">
-*
-* Variable passed from web page to WebFOCUS servlet.
-*
<input type="hidden" name="COUNTRY">
</form>
</BODY>
</HTML>
-HTMLFORM END 

Drill down report:
-* File drilldownreport.fex
TABLE FILE CAR
"Drill Down Report"
"Country => &COUNTRY"
SUM SALES/D9C
BY  CAR
BY  MODEL
WHERE COUNTRY EQ '&COUNTRY'
ON TABLE SET PAGE NOPAGE
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
 INCLUDE = ENInformationBuilders_Light1, $
 TYPE=REPORT, TITLETEXT='Drill Down Report',$
 TYPE=TITLE,  JUSTIFY=CENTER,$
ENDSTYLE
END  

There are, of course, many variations on this theme. :-)

This message has been edited. Last edited by: David Briars,
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
David,

You are awesome! Thanks for the implementation and help in understanding how the functionality could work.

I've reproduced your example in my environment and have it working, even in AHTML format to boot. I'm currently still having troubles passing multiple params at once into the Js function and then having it render.

Let's say we want to view all cars from England with sales of $12,000. If I try to add/pass SALES into the function, the report renders blank, and the source says it did not recognize the word (added param) on the line with JAVASCRIPT=...

I added:

TYPE=DATA, COLUMN=COUNTRY, JAVASCRIPT=fn_drilldown(COUNTRY, SALES), COLOR=BLUE,$


and added also:

function fn_drilldown(country, sales) {
   document.hiddenRunForm.COUNTRY.value = country;
   document.hiddenRunForm.SALES.value = sales;


as well as:

-*
-* Variables passed from web page to WebFOCUS servlet.
-*
<input type="hidden" name="COUNTRY">
<input type="hidden" name="SALES">


It doesn't like me adding another column value for some reason.

Have you used this functionality ever with several parameters/column values at once before? If so, can you show me how you implemented such?

Again, I really appreciate all your help thus far. This is great to know even if I can't get it working with several column value params.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Virtuoso
posted Hide Post
David (and everyone else),

Nevermind. Figured out the issue. I guess when specifying multiple params within the WF stylesheet area, you still utilize a blank space between arguments despite it being a call to a Js function. So we would write the call as follows:

TYPE=DATA, COLUMN=COUNTRY, JAVASCRIPT=fn_drilldown(COUNTRY SALES), COLOR=BLUE,$


and not like:

TYPE=DATA, COLUMN=COUNTRY, JAVASCRIPT=fn_drilldown(COUNTRY, SALES), COLOR=BLUE,$


despite that being the way one writes such in Js.

FINALLY!! lol Thanks again David for your time and help with the inquiries I have brought to the forums.

Hope this helps anyone who may be wondering about this in the future! Take care!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
Have you used this functionality ever with several parameters/column values at once before?

One of the strengths of this technique is how easy it is to add additional parms.

Once of course you add one to the first one. :-)

There isn't a comma in the JAVASCRIPT stylesheet parm. (Maybe b/c the command itself is comma delimited?) So COUNTRY, SALES becomes COUNTRY SALES.

Your JS code looks AOK to me!
 
Posts: 822 | Registered: April 23, 2003Report This Post
Virtuoso
posted Hide Post
David,

I totally agree. This is a very nice way to gain additional control over drilldown reports. That would make sense about the reasoning behind the the lack of commas in the arguments list. Appreciate it! Thanks again!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Need for setting size of target pop-up window of drill-down link:

Copyright © 1996-2020 Information Builders