Function ViewReport()
objReport.PrintOptions.PaperSize = CType(getPaperSize("8.5x7''").RawKind, CrystalDecisions.Shared.PaperSize)
nd Function
Public Function getPaperSize(ByVal sizeName As String) As System.Drawing.Printing.PaperSize
Dim i As Byte = 0
Dim PSize As New System.Drawing.Printing.PaperSize
Dim printDoc As New System.Drawing.Printing.PrintDocument
For i = 0 To printDoc.PrinterSettings.PaperSizes.Count - 1
If (printDoc.PrinterSettings.PaperSizes(i).PaperName = sizeName) Then
PSize = printDoc.PrinterSettings.PaperSizes(i)
End If
Next
Return PSize
End Function
Tag : .NET, Win (Windows App), VB.NET, VS 2008 (.NET 3.x)