Focal Point
maximum the browser

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

March 01, 2006, 08:19 AM
Mike Johnson
maximum the browser
How can I Maximize the browser window when the report output is PDF?

I found a response on this forum that provided a solution for HTML but it does not work for PDF.
March 01, 2006, 11:59 AM
dhagen
Do you need this to happen every time a pdf or excel report is executed?


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
March 01, 2006, 04:42 PM
Mike Johnson
Yes, I found a work around that works but would like to know if there is a way to this from the report itself.

The work around is add script code in HTML publish report that resizes window. This works fine but was just wandering if there was another way.

Thanks
March 02, 2006, 03:13 PM
dhagen
Mike,

I have a way of doing that, but tread carefully. If you are using the english version, then there exists a file called entmplts.wfs. In this file is a tag called "REDIRECT_BODY". This tag contains the html that is sent back to the browser whenever a redirrected mime type is called (eg: EXCEL, PDF etc). You can alter the contents of this and add the JS setting to maximize your window. So to do this dynamically, add the following before the REDIRECT_BODY setting:
<if> MY_MAX EQ "YES"
  MY_MAX_OUT=window.moveTo(0,0);window.resizeTo(screen.width,screen.height);
<else>
  MY_MAX_OUT=
<endif>


And change the function in the REDIRECT_BODY to now contain the MY_MAX_OUT parameter thusly:
 
REDIRECT_BODY=<HTML><Head><Title>WebFOCUS Report</Title>\n   \\=
<Script Language="JavaScript">\n                             \\=
<\!--\n                                                      \\=
function getrep() {\n                                        \\=
   &MY_MAX_OUT \n                                            \\= 
   if(parseInt(window.navigator.appVersion,10)<4)\n          \\=
 


Now, whenever you execute a report with either excel or pdf as the output, and there exists a parameter called &MY_MAX that is equal to "YES", then the end result will be a maximized screen.

Be warned, as there is no guarentee that this will work in future releases, as you should not be touching these files.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
March 02, 2006, 03:23 PM
Mike Johnson
Thanks,

I will save this code. But I don't have access to the file in question. I only have the MRE version of Developer Studio. Thanks again.