Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Posts
    18

    Unanswered: Printing A5 rotate report

    I made a report for A5 size, the orientatian is "normal". When a place A5 paper in my printer (in the same orientation as with A4), it works perfect. Well almostperfect because my Canon printer has some diffulculties to keep get the paper from stack, cauese it can't use the 210 mm it normally uses with A4.
    So I want to know how I can print my report the right way feeding the paper landscape. In other words, is it possible to send my report to the printer rotated 90 degrees

    Thanks

  2. #2
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    I guess you are looking for VBA solution....

    this works in Access2000:

    you cannot change report's paper size, orientation, .... in preview mode, you have to do it in design mode.

    attached is very universal code, it allows you to change report's orientation, size and tray (maybe you have two trays...). You can easily extend it for other properties....

    I have let's say report called "Report1", before I print it, I call this small
    function....

    SetupReportPage Orientation, PaperSize, Tray, ReprtName

    you can see list of all the possible sizes in Access Help. Search for PrtDevMode

    this sample setups landscape, A5, manual bin

    SetupReportPage 2, 11, 4, "Report1"
    docmd.OpenReport "Report1",acViewPreview


    jiri




    ****************
    Option Compare Database
    Type str_DEVMODE
    RGB As String * 94
    End Type

    Type type_DEVMODE
    strDeviceName As String * 16
    intSpecVersion As Integer
    intDriverVersion As Integer
    intSize As Integer
    intDriverExtra As Integer
    lngFields As Long
    intOrientation As Integer
    intPaperSize As Integer
    intPaperLength As Integer
    intPaperWidth As Integer
    intScale As Integer
    intCopies As Integer
    intDefaultSource As Integer
    intPrintQuality As Integer
    intColor As Integer
    intDuplex As Integer
    intResolution As Integer
    intTTOption As Integer
    intCollate As Integer
    strFormName As String * 16
    lngPad As Long
    lngBits As Long
    lngPW As Long
    lngPH As Long
    lngDFI As Long
    lngDFr As Long
    End Type

    Sub SetupReportPage(InputOrientation As Integer, InputPaperSize As Integer, InputPaperSource As Integer, InputReportName As String)

    Dim strDevModeExtra As String
    Dim DevString As str_DEVMODE
    Dim DM As type_DEVMODE

    DoCmd.OpenReport InputReportName, acViewDesign
    DoCmd.Minimize
    strDevModeExtra = Reports(InputReportName).PrtDevMode
    DevString.RGB = strDevModeExtra
    LSet DM = DevString
    DM.intPaperSize = InputPaperSize
    DM.intDefaultSource = InputPaperSource
    DM.intOrientation = InputOrientation
    LSet DevString = DM
    Reports(InputReportName).PrtDevMode = DevString.RGB
    DoCmd.Close acReport, InputReportName, acSaveYes
    End Sub

    **************
    Last edited by playernovis; 01-09-03 at 01:03.

  3. #3
    Join Date
    Oct 2002
    Posts
    18

    Works Almost perfect

    Thanks,
    It looks to be the right way. But I got a litle problem with the marge. When I print on A5 normal the marges are perfect and the report is printed on one page. But when I change it to landscape the report needs two pages. I've tried to change the marges but even but the top adn left margin to zero, the report still start after around 8 cm.
    I would be very greatfull if someone can tell me how to solf this problem

Posting Permissions

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