Try
Dim strReportPath As String = System.Windows.Forms.Application.StartupPath & "\CR.rpt"
If Not IO.File.Exists(strReportPath) Then
Throw (New Exception("Unable to locate report file:" & vbCrLf & strReportPath))
End If
rptDocument.Load(strReportPath)
CrystalReportViewer1.ReportSource = rptDocument
CrystalReportViewer1.Zoom(25)
Dim custompos As Integer
Dim customnumber As Integer
For custompos = 0 To PrintDocument1.PrinterSettings.PaperSizes.Count - 1
If PrintDocument1.PrinterSettings.PaperSizes.Item(custompos).PaperName = "US Std Fanfold" Then
customnumber = PrintDocument1.PrinterSettings.PaperSizes.Item(custompos).RawKind
Exit For
End If
Next
rptDocument.PrintOptions.PaperSize = customnumber
rptDocument.PrintToPrinter(1, True, 0, 0)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Subscribe to:
Post Comments (Atom)

hi vennila,
ReplyDeleteall the best for your blog.
regards,
rajeshkumar govindarajan