CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    May 1999
    Posts
    3,332

    printing DataReport in Landscape mode

    How do you print a data report in landscape orientation?

    Yes, this question has been asked before, but I have searched this forum and found no working solution.

    We did set the orientation of the printer object: no luck.
    We also used the pageset.DLL from an MSDN article: still no luck.

    Does anyone have a working solution?


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

    Re: printing DataReport in Landscape mode

    Hi

    Karl E Peterson wrote up an article on this several months back in the VBPJ. You could either try their web site at http://www.vbpj.com, or Karl's at http://www.mvps.org/vb.

    Failing that, give me a shout, and I'll try and find it when I get home and post it here.


    Chris Eastwood

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

  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: printing DataReport in Landscape mode

    Hi Chris,
    couldn't find anything on the sites you mentioned.
    hopefully you find the URL, soon.

    Thanks


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

    Re: printing DataReport in Landscape mode

    Unfortunately, I only have the 'hard-copy' magazine code. I remember Karl saying that it's down to a bug in the DataReport and he gave some code as a solution. I'll post it (probably very late) this evening for you.


    Chris Eastwood

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

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

    Re: printing DataReport in Landscape mode

    Hi Lothar

    Sorry, it wasn't Karl Peterson, but Phil Weber who wrote the article (not that it matters, because he doesn't have a website).

    I've posted the code at :

    http://codeguru.developer.com/vb/articles/1926.shtml

    - make sure you read the text of the article so you understand the implications of doing it this way though !



    Chris Eastwood

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

  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: printing DataReport in Landscape mode

    Hi Chris,

    Thanks a lot. I'm going to check it out very soon.
    Do you know the URL of the original article on vbpj? I can't find <i>anything</i> on their website.


  7. #7
    Join Date
    May 1999
    Posts
    3,332

    Re: printing DataReport in Landscape mode

    :-(
    I tried it, and it did NOT work.
    It tried your original code and the form was printed in landscape mode, OK.
    Then I tried to print a datareport in landscape mode with the following code and
    it did not work. The report was printed in portrait mode.

    private Sub Command1_Click()
    Dim iSaveOrient as Integer
    DataEnvironment1.Connections(1).Open
    iSaveOrient = Printer.Orientation
    SetPrinterOrientation OrientLandscape
    DataReport1.PrintReport
    Printer.EndDoc
    SetPrinterOrientation iSaveOrient
    End Sub




    This was tested with VB 6 SP3, NT 4 SP 5 on a Lexmark Optra printer.

    I also added tons of error handling code to the SetOrientation procedure, but no runtime errors occurred anywhere.
    Still, the report is NOT printed in landscape mode.
    Any more hints?



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

    Re: printing DataReport in Landscape mode

    Hmmm

    Well, I copied the code from the downloadable file and the article assures me that it works. You can't get to the original article on http://www.vbpj.com unless you are a 'premier' member (ie. you pay).

    You can however download the code from there using the 'Locator' code (really logical !) of 'VBPJ0599' - but you also need to be a registered member (although that's free).

    The VBPJ0599 contains all the code from the may edition (zipped) - the one you'll be looking for is something like 'VBPJ0599AP.ZIP' (well, it definately ends in 'AP') - mail me if you can't find it and I'll send it to you.



    Chris Eastwood

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

  9. #9
    Join Date
    May 1999
    Posts
    3,332

    Re: printing DataReport in Landscape mode

    OK, I found the code and it looks "OK".
    Well, I also issued a service request with MS premier support.


  10. #10
    Join Date
    May 1999
    Posts
    3,332

    Re: printing DataReport in Landscape mode

    what MS says:
    if pageset.dll doesn't work, bad luck.
    if it does work, good luck, but it (=pageset.dll) is still not a supported product.
    Try something better like MS access or a third-party reporting engine.

    So much for product support :-(


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