Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to always "Export to PDF" in a New Window

PowerPlay Entreprise Server

How to always "Export to PDF" in a New Window

by  Draoued  Posted    (Edited  )
This is valid for PPES7.1

It's possible to change the JavaScript in order to export to PDF in a new window.

In the Gateway server
Folder: \cer3\webcontent\ppwb
File to be modified: ppwbpdfpagesettings.js

Make a backup copy of this file to keep the original file.

Edit ppwbpdfpagesettings.js and search for the function submitExportDialog().

Function looks like this:

function submitExportDialog()
{
//get current values of pdf options
var orientation = document.pdfForm.portrait.checked;
if(orientation != undefined)
...
...
...
if ( !target._fhchanged )
{
target._fhchanged = true;
target._fhtarget = fh.target;
target._fhaction = fh.action;
target._fhRA = fh.RA.value;
}
fh.action += "?MIME=.PDF";
target.doit(command);
return;
}


Add the following blue lines so that the function looks like:

function submitExportDialog()
{
//get current values of pdf options
var orientation = document.pdfForm.portrait.checked;
if(orientation != undefined)
...
...
...
if ( !target._fhchanged )
{
target._fhchanged = true;
target._fhtarget = fh.target;
target._fhaction = fh.action;
target._fhRA = fh.RA.value;
}
[blue]CurrentValuefhtarget = target._fhtarget; // Saving target window
CurrentValueTarget = fh.target; // Saving target window
target._fhtarget = "_blank" ; // Changing target
fh.target = "_blank" ; // Changing target[/blue]
fh.action += "?MIME=.PDF";
target.doit(command);
[blue]target._fhtarget = CurrentValuefhtarget; // reset Target window
fh.target = CurrentValueTarget ; // reset Target window[/blue]
return;
}

Code explanations:
The first 2 added lines are storing the target window value in new variables.

Then _fhtarget and fh.target value are changed to _blank.
_blank is a key word for Internet explorer, so it always opens a new window.

Then after the "Export to PDF" command is sent, the target window variables are resetted to what they were.
If the target window variables are not resetted, any action in the "Export to PDF" Frame creates a new window.

Both variables target._fhtarget and fh.target need to be changed because of Dynamic and Enhanced layouts.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top