473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dynamic Report Landscape Orientation

23
I'm using VB in Access 2003 to generate a dynamic report. I first open the report in design view to set all the grouping levels etc. I then use

Expand|Select|Wrap|Line Numbers
  1.  with rpt 
  2.            .printer.orientation = acProrlandscape
  3.             ...
  4.           End With 
I then open and display the report using docmd and acviewpreview.

The report opens everytime in Portrait, although the page setup is correctly set to Landscape. If I manually view the report in design view and then go back to print preview, the Landscape settings finally take effect.

Does anyone know what I should do that it automatically opens in Landscape? The end users can't be trusted to click in and out of design view.
Sep 8 '08 #1
2 8696
ADezii
8,834 Expert 8TB
If you have Access 2002 or above:
  1. Open the Report in Hidden Window Mode
  2. Change the Report's Orientation
  3. Print the Report
  4. Close the Report
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "<Report Name>", View:=acViewPreview, WindowMode:=acHidden
  2. Reports("<Report Name>").Printer.Orientation = acPRORLandscape
  3. DoCmd.OpenReport "<Report Name>"
  4. DoCmd.Close acReport, "<Report Name>"
Sep 9 '08 #2
J360
23
Thanks, but i need to open the report in Print Preview mode rather than opening it normally. Because of this, I keep getting an error that I can't set the orientation in the subreport when i set orientation in design view as you suggested.

Any other suggestions? I tried to write some code that sets landscape, and then switched between design and preview views in the hopes it would replicate physically clicking, but this doesn't work. One currently must see it in portrait, click design, and click back to view it in landscape.
Sep 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Devesh Aggarwal | last post by:
I developed reports in Crytsal Reports 9.0 in landscape mode. When i print the same from crystal reports it prints perfectly in Landscape even if the printer setting is set to potrait by default. ...
3
by: CSDunn | last post by:
Hello, I have a situation with MS Access 2000 in which I need to display report data in spreadsheet orientation (much like a datasheet view for a form). If you think of the report in terms of what...
2
by: tom | last post by:
Hi All, Using VBA, I would like to be able to examine a report in design mode and determine its page orientation (landscape or portrait). I do not want to change the orientation. I'm fine...
12
by: Connor T | last post by:
Hi, I have a crystal report embedded in a viewer. How / Where can I set a property to make it default to landscape orientation? Rgds, Dan
0
by: DavidGeorge | last post by:
I have an application with a number of reports, some in Landscape, some in Portrait orientation. I need to be able to select each of these reports separately at times. However, at the end of...
0
by: brett | last post by:
Hi, I need to build a pdf report by using Crystal report which including several subreport. The problem is that the primary page orientation is portrait and some subreports' orientation is...
3
Zwoker
by: Zwoker | last post by:
Hi all, In MS Access 2003 I'm trying to produce a report that has the some sections (the header section for the first sort item) in Landscape, and the rest in Portrait. I tried using code like...
10
by: sara | last post by:
Hi - I have a report that is 14 columnar sub-reports (Line up: Position- holders in each of our 14 locations - Manager, Assistant Manager, Receiving, Office, etc). I output directly to PDF...
4
by: J360 | last post by:
Access 2003. I've set the report orientation to landscape using VB. The report that pops up is in Portrait view, but page orientation is correctly set to Landscape and it prints in landscape...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.