hardcoding page layout in reports

  • Thread starter Thread starter Tom Green
  • Start date Start date
T

Tom Green

Access 97, 2000, 2003
Windows 2000, XP Pro
I've never been able to get the page orientation setting to stick to a
report, the report always opens by default on the last setting that was used
(from what I can tell). Is there a way around this issue? This is tantamount
to failure from the user perspective.

Thanks much
 
Tom:

1.) If you are using Access 2000, then make sure that you've installed all
the service releases for that version as the problem you are experiencing is
a known bug that was fixed in Service release 1.

2.) Notwithstanding that, make sure that all your reports are set to use the
default printer. Normally they will hold their layout with the exception
of if they are opened in preview and then the user uses the File -> Print
command and brings up the print dialog and switches printers the report,
when the new printer is selected will "assume" the default layout of the
newly selected printer. This is an historic Access report issue as you've
found.

The work around is to create on any form where you have a command to preview
or print a report your own printer selection combo where the user selects
the printer before previewing, and then you set the default printer via code
based on that selection. When this method is used (i.e. not using the
Access print dialog, with the report set to use the default printer) then
Access will maintain the report's specified settings when it is previewed
and printed. Normally when you do this, you have to create a custom
toolbar and menu for your reports that eliminates the Print functionality so
that it is only controlled from your form (so the user can't access the
print dialog.)

3.) If you don't want to code this all out yourself, you might look at our
"On the Fly Printing" code and classes. It provides two classes for
printing reports, one providing access to the print dialog which will retain
a report's layout, and a second that will allow you to create the combo box
and set default printers like was discussed in item 2 above. You'll find it
on our web.
 
Thank you for the information. I can think of no reason why Access is
designed such that report layout and print setting do not travel with the
report itself. In this case this is a multiuser environment where multiple
users use a machine on a specific desk under different user profiles. Each
might have a different default printer selected based on personal
preference, color or b/w etc. If I were to hardcode the application with a
specific printer I cannot even guarantee that all the users would have that
printer installed in their profile - nor could they install it without the
intervention of the IT staff.

It's a massive Access design flaw if you ask me, all legacy postscript
issues aside.
 
Tom:

Possibly you mis-understood. Generally all report layout and set up
properties DO travel with the report unless the report is set to use a
specific printer and that printer is not available on the current PC or the
user previews the report and then switches printers using the built in
Access print dialog. In the later case Access queries that printers default
settings and load them into the report that is being previewed which in some
cases (e.g. landscape, legal paper etc.) will hose the report design unless
those properties are reset when the printer is choosen.

So

1.) Always have your reports set to use the default printer. In that case
if printing is started while the report is closed, then your layout specs
are retained.

2.) Create custom toolbars and menus for reports that are previewed that
don't include the option to Print.... from a preview (which would normally
bring up the print dialog) which could reset layout; allowing printing to
the default printer is ok. Rather give the user the option to set the
default printer to use BEFORE the report is previewed or printed (by putting
a printer combo on your form) and again if that is done, then report layout
specs will also be maintained.
 
Back
Top