Focal Point
[SOLVED] choice of inline frame or new window for report output

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

June 10, 2009, 12:30 PM
JohnB
[SOLVED] choice of inline frame or new window for report output
Currently the reports in this company all display in an inline frame within the launch page. This is very limiting. I would like to give the users a choice of having the reports display in either the inline frame or in a separate window.

Can this be done without JavaScript?

There are no JavaScript coders here, so if it can only be done with JavaScript, I would appreciate it if the JavaScript code would be posted here.

Thank you,

John

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


WF 7.7.03, Windows 7, HTML, Excel, PDF
June 10, 2009, 03:07 PM
Francis Mariani
John,

I'm not going to discuss whether or not this is a good idea - I'm sure someone else will, I'm going to provide a possible solution.

The form target attribute specifies where the form result will go. You can alter this using JavaScript, based on the selection in a form object like a radio button or a select list.

You would add a form object where the user selects the output destination - the inline frame, a new window or a named window. (If a new window is selected, the form will always open a new window; if a named window is selected, the form will open a new named window if it doesn't exist - if it does exist, the form result goes in the already opened window).

You would then add execution of a JavaScript function to the form using the onSubmit attribute.

Add the function to the HTML page, before the body tag.

An example:

<html>

<body>

<form name="form1" method="get">
Report Destination
<select name="seltarget">
  <option value="iframe1" selected="selected">Inline</option>
  <option value="_blank">New Window</option>
  <option value="winreport">Report Window</option>
</select>
</form>

<p>

<form name="form2" method="get" action="http://www.google.com/" target="iframe1"
      onSubmit="document.form2.target = document.form1.seltarget[document.form1.seltarget.selectedIndex].value;">

<input type="submit" value="Submit" />

</form>

<iframe NAME="iframe1" frameBORDER="1" width="600" height="400" scrolling="auto"></iframe>

</body>
</html>

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 10, 2009, 11:46 PM
Tony A
IB do this within Amper Autoprompting -

              <input id="idReportTarget" name="reportTarget" type="checkbox"/>
              <span>Run in a new window</span>

For the checkbox selection for the end user and

  if(document.getElementById("idReportTarget").checked) {
    targ = "_blank";
  } else {
    targ = "outputFrame";
  }
  document.getElementById("idWFDescribeForm").setAttribute("target",targ);
  WFDescribeForm.submit();

The only thing that I would say is that if you have no JavaScript coders then how do you plan to support any JS code you get given?

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 
June 11, 2009, 12:47 PM
JohnB
Thank you guys.

Good point, Tony.

Regards,

John


WF 7.7.03, Windows 7, HTML, Excel, PDF