Focal Point
[SOLVED] Need new window for PDF, same window for EXL07

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

March 28, 2014, 07:43 PM
George Patton
[SOLVED] Need new window for PDF, same window for EXL07
Folks,

We don't use M$ Office products in our company and do very well with Open Document software - currently using both Lotus Notes Symphony and OpenOffice.

Since the introduction of EXL07 we can happily open up WF spreadsheet output in either of these products without any issues. We get a prompt at the bottom of the window that contains the launch page and just have to click it to open the spreadsheet.

However all of our reports are available in both PDF and spreadsheet formats. I typically choose "Open in New Window" when setting up the Run button on the launch page to accommodate the PDF output.

This works great for the PDF output. But for the spreadsheet it pops up a blank window that actually obscures the prompt to open the spreadsheet (which is at the bottom of window containing the launch page).

So it is necessary to close the blank page and then click the prompt.

It's not a burning issue, but it would be nice:

IF &WFFMT EQ 'PDF' THEN {New Window} ELSE {Same Window};

I saw an earlier post with the suggestion of TYPE=REPORT, TARGET=_new, $

But I'm not clear how that would work from a launch page where the window is a function of the Run button

I've been musing about the notion of two Run buttons - one for PDF and one for spreadsheet.

I'd appreciate any suggestions on this topic.

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


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
March 30, 2014, 08:40 AM
j.gross
How about adding two hidden Run buttons, and use javascript to trigger the OnClick of the one or the other, depending on the state of the WFFMT control when the visible button is clicked.
March 31, 2014, 04:11 AM
Tony A
quote:
how that would work from a launch page where the window is a function of the Run button

Hi George,

I think that this may be to do with default program (local PC) and redirection settings (WF Server).

Unfortunately(?) I do not use lotus or open office and so have not hit this.

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 
March 31, 2014, 10:03 AM
Kamesh
If you want to do this using an launch page then modify the request xml tag using an javascript function.

see the code below.

var reqid=0; //your request id
if (myXmlRoot || loadXmlDoc())
{
var pattern = "//requests/request[@requestid='" + reqid + "']";
var requestNode = getSingleNode(myXmlRoot, pattern);
if (requestNode)
{
if(fmt == "EXL2K"){
requestNode.setAttribute("targettype","_self");
requestNode.setAttribute("targetname","framename or where you want to display");
}
else{
requestNode.setAttribute("targettype","_blank");
requestNode.setAttribute("targetname","window");
}
}
}


Hope this helps.


WFConsultant

WF 8105M on Win7/Tomcat
April 01, 2014, 10:28 AM
JALDbaDev
This code works well for us. We added a checkbox for new window output on our form and as stated above, added 2 hidden buttons to our form: 1) btn_newwin and 2) btn_iframe - if the new window box is not checked by the user, the report is displayed in a frame. And here's the code:

function btn_Run_onclick(ctrl) {
// Check to see if the New Window box is checked,
// if so use hidden button to open new window, else use hidden button to use iframes


if (document.getElementById('checkbox1_0').checked == true)
{
document.getElementById('btn_newwin').click();
}
else
{
document.getElementById('btn_iframe').click();
}
OnExecute(ctrl)
}

//Begin function btn_newwin_onclick
function btn_newwin_onclick(ctrl) {
OnExecute(ctrl)
}
//End function btn_newwin_onclick

//Begin function btn_iframe_onclick
function btn_iframe_onclick(ctrl) {
OnExecute(ctrl)
}
//End function btn_iframe_onclick
April 01, 2014, 10:40 AM
George Patton
Folks, great suggestions all !

Now the bad news: My javascript skills are very poor. so it will take me a while to absorb this and put it into practice. Sweating


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP