VB6 DataReport - Landscape printing problems 
Author Message
 VB6 DataReport - Landscape printing problems

Quote:

> Go here:
> http://www.*-*-*.com/

Thanks, JBL.  An easy solution to a pressing problem.  It works great.
My code is posted below, if anyone is interested.

Dan

===============================
Option Explicit

' -----------------------------------------
' -- Printer functions to set orientation
' -- PageSet.dll must be registered in Windows and in VB6

' -- Examples for rptLandscape

    'Private Sub cmdPrintPreview_Click()
    '    PrintPreview rptLandscape,  vbPRORLandscape
    'End Sub

    'Private Sub cmdPrintAll_Click()
    '   PrintReport rptLandscape, vbPRORLandscape
    'End Sub

' -- Use similar calls for vbPRORPortrait

' ------------------------------------------
Public Sub PrintPreview(rptReport As Object,  intMode As Integer)
' -- Note:   rptReport argument is set to 'Object' rather than  
'               'DataReport' to get around a VB6 bug.

    On Error GoTo errorhandler

    SetPrinterOrientation intMode
    rptReport.Show

    On Error GoTo 0
    Exit Sub

errorhandler:
   MsgBox Err.Description

End Sub

' ------------------------------------------
Public Sub PrintAll(rptReport As DataReport, intMode As Integer)
' -- Prints the entire report without displaying the dialog

    On Error GoTo errorhandler

    SetPrinterOrientation intMode
    rptReport.PrintReport False

    On Error GoTo 0
    Exit Sub

errorhandler:
   MsgBox Err.Description

End Sub

' ------------------------------------------
Private Sub SetPrinterOrientation(intMode As Integer)
Dim obj As PageSet.PrinterControl

    On Error GoTo errorhandler

    Set obj = New PrinterControl
    If intMode = 2 Then
       obj.ChngOrientationLandscape
    Else
       obj.ChngOrientationPortrait
    End If

    On Error GoTo 0
    Exit Sub

errorhandler:
   MsgBox Err.Description

End Sub

' ------------------------------------------
Public Sub ResetPrinter()
' -- To reset the printer
' -- OK to call after a hardcopy print (e.g., PrintAll)
' -- Do NOT call immediately after a call to PrintPreview.
Dim obj As PageSet.PrinterControl

    On Error GoTo errorhandler

    Set obj = New PrinterControl
    obj.ReSetOrientation

    On Error GoTo 0
    Exit Sub

errorhandler:
   MsgBox Err.Description

End Sub



Tue, 01 Jan 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. VB6 DataReport - Landscape printing problems

2. printing landscape report with VB6 datareport?

3. VB6 DataReport Landscape

4. VB6 DataReport Object - Displaying Landscape Reports

5. How to design report in VB6 DataReport in landscape orientation

6. How use VB6 DataReport with landscape orientation.(none)

7. How do setup the landscape mode in the VB6 - Datareport

8. How do setup landscape mode in VB6-Datareport ?

9. Landscape datareport in vb6?

10. Landscape datareport in vb6?

11. Need help by printing a datareport in landscape-format

12. DataReport and landscape printing

 

 
Powered by phpBB® Forum Software