Results 1 to 2 of 2

Thread: access report orientation -how to set it to landscape

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    94

    access report orientation -how to set it to landscape

    How do i set my report in access so that the orientation is always landscape

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Posts
    424
    VB Code:
    1. Type str_DEVMODE
    2.     RGB As String * 94
    3. End Type
    4.  
    5. Type type_DEVMODE
    6.     strDeviceName As String * 16
    7.     intSpecVersion As Integer
    8.     intDriverVersion As Integer
    9.     intSize As Integer
    10.     intDriverExtra As Integer
    11.     lngFields As Long
    12.     intOrientation As Integer
    13.     intPaperSize As Integer
    14.     intPaperLength As Integer
    15.     intPaperWidth As Integer
    16.     intScale As Integer
    17.     intCopies As Integer
    18.     intDefaultSource As Integer
    19.     intPrintQuality As Integer
    20.     intColor As Integer
    21.  
    22. intDuplex As Integer
    23.     intResolution As Integer
    24.     intTTOption As Integer
    25.     intCollate As Integer
    26.     strFormName As String * 16
    27.     lngPad As Long
    28.     lngBits As Long
    29.     lngPW As Long
    30.     lngPH As Long
    31.     lngDFI As Long
    32.     lngDFr As Long
    33. End Type
    34.  
    35. Sub SwitchOrient(strName As String)
    36.     Const DM_PORTRAIT = 1
    37.     Const DM_LANDSCAPE = 2
    38.     Dim DevString As str_DEVMODE
    39.     Dim DM As type_DEVMODE
    40.     Dim strDevModeExtra As String
    41.     Dim rpt As Report
    42.     DoCmd.OpenReport strName, acDesign          ' Opens report in Design view.
    43.     Set rpt = Reports(strName)
    44.     If Not IsNull(rpt.PrtDevMode) Then
    45.         strDevModeExtra = rpt.PrtDevMode
    46.         DevString.RGB = strDevModeExtra
    47.         LSet DM = DevString
    48.         DM.lngFields = DM.lngFields Or DM.intOrientation    ' Initialize fields.
    49.  
    50. If DM.intOrientation = DM_PORTRAIT Then
    51.             DM.intOrientation = DM_LANDSCAPE
    52.         Else
    53.             DM.intOrientation = DM_PORTRAIT
    54.         End If
    55.         LSet DevString = DM                     ' Update property.
    56.         Mid(strDevModeExtra, 1, 94) = DevString.RGB
    57.         rpt.PrtDevMode = strDevModeExtra
    58.     End If
    59. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width