Ramesh Srinivas
asked on
Programmatically set print option to Landscape - crystal viewer...
Hi All,
I have been looking at ways to set the print layout to landscape programmatically (windows forms, crystal viewer). Does anyone know if this is possible? Would I need to create my own print button instead of the report viewers?
I found this, but not sure how to implement it for my scenario:
Private WithEvents myDocumentToPrint As PrintDocument
Dim aPS As New PageSetupDialog
aPS.Document = myDocumentToPrint
'
' On the 1-rst call to the print dialog initialize the document's
' properties. On subsequent calls use what was previously set.
'
If Not myPageSetUp Then
With aPS.Document.DefaultPageSe ttings
.Margins.Top = 50
.Margins.Left = 50
.Margins.Right = 50
.Margins.Bottom = 50
.Landscape = True
End With
End If
I got this code from: http://www.thescarms.com/dotNet/PrintDataSet.asp
I appreciate any help on this.
regards,
KS
I have been looking at ways to set the print layout to landscape programmatically (windows forms, crystal viewer). Does anyone know if this is possible? Would I need to create my own print button instead of the report viewers?
I found this, but not sure how to implement it for my scenario:
Private WithEvents myDocumentToPrint As PrintDocument
Dim aPS As New PageSetupDialog
aPS.Document = myDocumentToPrint
'
' On the 1-rst call to the print dialog initialize the document's
' properties. On subsequent calls use what was previously set.
'
If Not myPageSetUp Then
With aPS.Document.DefaultPageSe
.Margins.Top = 50
.Margins.Left = 50
.Margins.Right = 50
.Margins.Bottom = 50
.Landscape = True
End With
End If
I got this code from: http://www.thescarms.com/dotNet/PrintDataSet.asp
I appreciate any help on this.
regards,
KS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
# of Copies, collated as Boolean, StartPage, EndPage
crReportDocument.PrintToPr
ASKER