"Biguana" <te******@yahoo.co.uk> wrote:
Just wondering if anyone can help here. We have a site where most of
the site opens in a window with no toolbars or menubar:
window.open('mypage.aspx','self','toolbar=0, menubar=0, etc, etc)
This is because it's a data driven site where space is at a premium and
Do the actual end users of the site appreciate this choice? Or would
they rather devote a little bit of space to the basic browser
functions that they can use on every other site? Oh well, an
increasing number of users are using browsers that don't let you
remove the toolbars anyway.
we'd rather discourage use of back, stop and refresh.
Then you should code your application so that it copes gracefully with
such things. You have to do that anyway as those functions are
available to the user via keyboard shortcuts, context menus, mouse
gestures, etc. as well as via the toolbar that you've managed to
remove (sometimes).
The problem arises because some "view data" pages are designed to be
printed and have an onclick="window.print();" button, but the data
tables won't fit properly on portrait A4 (they are designed for
landscape)
So you take away basic browser functions by using JavaScript to open a
new window, and then try to recreate them with more JavaScript only to
realise that you can't recreate them fully.
By the way what happens on your site for users who don't have
JavaScript enabled?
and there doesn't seem to be any way to default the page
setup to landscape from the html.
Nor should there be. HTML is designed for marking up data. It's about
what something is, not about how something is presented in one
particular medium.
It seems like an obvious thing to
have - surely the default page layout should be a property of the
document, not the software (as with a word processor).
But on the WWW you have no idea what printers are connected to your
users machines. Some may not have the ability to print in landscape
mode, some may use paper sizes large enough to fit the print out on a
portrait page, etc.,
CSS 2 had a property, size, that allowed you to suggest the
orientation of the printed page. It was dropped from CSS 2.1 due to
lack of support but something similar will be in CSS 3. None of which
is of any use to you as IE only supports a small amount of CSS.
The CSS 2.1 spec says:
"If a page box does not fit the target sheet dimensions, the user
agent may choose to:
Rotate the page box 90° if this will make the page box fit.
Scale the page to fit the target.
The user agent should consult the user before performing these
operations."
IE doesn't do that either. Some better browsers do to varying degrees
(e.g. I use Opera 8 and it can scale the print out to fit the page).
Getting the user to change the page setup in the parent browser doesn't
help as the child window doesn't inherit the page setup. Some printer
setups will allow setting to landscape from a "properties" button in
the print dialogue, but that's printer specific. The page setup is the
obvious place to set the orientation.
But you've taken the decision to remove access to the page setup
dialogue. You can't have it both ways.
Does anyone know of a way to do this? Obviously I'd prefer something
non-browser-specific, but all our users are on ie 5.0+ so anything for
ie would be better than nothing.
As a user I would overcome the problem as follows (assuming I was
forced to use IE rather than a browser that doesn't allow authors to
switch off access to basic functionality) -
1. Right click on the page and select Properties
2. Select the page URL and copy
3. CTRL+N to open a new browser window
4. Paste URL into the address bar and load page
5. Access Page Setup and Print the page normally.
As an author I see two possible options for you:
1. Review the decision to remove access to basic browser functions.
2. Look for an Active-X control that lets you change the IE page setup
options from with the web page.
Obviously (1) is cross browser whilst (2) is Windows IE only and
relies on your users being willing to take the security risk of
allowing Active-X controls to run.
Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor
Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>