HOW TO SET Crystal Sub report Paper source
-
Hi Guys, I have a Crystal report with a sub report. i need to set the subreport to use paper from an alt. tray from the printer. any ideas?
rptMain.Subreports(0).PrintOptions.CustomPaperSource = GetSelectedPaperSource(Me.cbDft.Text.Trim)
Private Function GetSelectedPaperSource(ByVal paper As String) As System.Drawing.Printing.PaperSource
Try
Dim selectedPaperSource As System.Drawing.Printing.PaperSource = New System.Drawing.Printing.PaperSource
Dim myPrinterSettings As System.Drawing.Printing.PrinterSettings = New System.Drawing.Printing.PrinterSettings()
myPrinterSettings.PrinterName = Me.lblPrinter.Text.Trim
For Each myPaperSource As System.Drawing.Printing.PaperSource In myPrinterSettings.PaperSources
If myPaperSource.SourceName = paper Then
Return myPaperSource
End If
NextCatch ex As Exception Throw New Exception(ex.Message & vbCrLf) End Try End Function
thanks