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     Javascript question - How to set printer orientation

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Javascript question - How to set printer orientation
 Login/Join
 
<Nathan>
posted
I have created print button using
following javascript

How to default printer setting to landscape ?

I am using following

window.print()
 
Report This Post
Expert
posted Hide Post
I don't think there's any method to setting the paper size or orientation, print() simply open the Print dialog box.

From the JavaScript manual by Goodman:

quote:

Like several other new window methods for Navigator 4, print( ) provides a
scripted way of invoking the Print button in the toolbar, whether the toolbar is
visible or not. Printing, however, is a little different, because a user � and now a
script � can specify that the entire browser window be printed or just a particular
frame. If you build a reference to the print() method with a reference to a frame,
then just that frame will be printed. To prevent a rogue print() command from
tying up a printer without the user�s permission, the print() method goes only so
far as to present the browser�s print dialog box. The user must still click the OK or
Print button (depending on the operating system) to send the window or frame
content to the printer.
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
The way I do it usually is provide a print link on the html page which opens the same fex in PDF. You can set the orientation in PDF format.

M
 
Posts: 33 | Location: New York, USA | Registered: August 11, 2003Report This Post
<Nathan>
posted
Thanks Francis and Mickey.
 
Report This Post
Expert
posted Hide Post
Nathan,<br /><br />
If you must control it from an
HTML page then

Meadriod

furnish an activeX component that
will achieve all the printing
control you could wish for(?).
Seelct ScriptX from their mainpage.
I have successfully used it on
a couple of contracts where the
requirement was for a user to be
able to print the report as
landscape without having to
print-setup and selecting
landscape all the time.
I included HTML tags for a print
button and the control which you
can achieve via a define or compute.
Bear in mind the efficiencies of
the report and the number of expected lines of
output before using it in a define though!
Code sample -<br />
PRINT_BUTTON/A395 = 
'<div id="PrintButton" 
style="position:absolute; top:25;<br /> left:750; 
visibility:hide; cursor:hand; z-index:1;" 
valign="middle" align="center">
<font size=-1>Print</font><img src="http://server/images/printer.gif"
width="30" height="30" alt="
Click here to print" onclick="printReport();">
</div>' ;PRINT_SRCE/A170 = 
'<object id="factory" 
style="display:none" viewastext
classid="clsid:1663ed61-23eb-11d2-b92f-
008048fdd814"<br /> codebase="../Components/ScriptX.cab#Version=6,0,0,421"></object>' ;        

This message has been edited. Last edited by: <Mabel>,
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report 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     Javascript question - How to set printer orientation

Copyright © 1996-2020 Information Builders