CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 1999
    Posts
    15

    Printing Datareports with landscape mode

    Hi There:

    I am having a problem showing the Datareport when I set the report width to display say 12 or so columns of data. For this to be possible extend the report width in design mode and set the appropriate column labels. When I then try to run the report using

    datareport.show

    I get the error message:

    "Report Width greater than paper width".

    apparently, by default the report is generated in Portrait mode when I need landscape mode (assume paper size is 8.5"x11").

    I checked the documentation and tried the following code:


    set Printer = Printers(0) ' only one printer installed on my computer
    Printer.Orientation = vbPRORLandscape

    denvNWind.dcnNWind.Open connectstr, "Admin", ""
    If IsNumeric(txtCountry.Text) = false then
    denvNWind.qryGetCustomerList txtCountry.Text, txtCity.Text
    txtCountry.Text = ""
    txtCity.Text = ""
    DataReport1.Show
    End if





    However, even after setting the orientation, I still get the same error message. What am I doing wrong. As it is, I am stuck with creating reports only in portrait mode (report width < 6" width in design mode).

    I am designing a database program to store electric motor specifications and typically there can be 15 or more columns of specs for each motor.

    sincerely,
    Hansel
    [email protected]




  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: Printing Datareports with landscape mode

    There's some code at http://codeguru.developer.com/vb/articles/1926.shtml that explains how to change the printer to landscape orientation just before printing it and then change it back again.

    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured