VSView Reporting Edition Reference > VSReport Control > VSReport Methods > Render Method |
Renders a report into a VSPrinter control.
[form!]VSReport.Render VSPrinter As Object
This method causes the control to render the current report into a VSPrinter control.
The method does not return until the report has been completed (or until an error occurs). To avoid freezing your application while long reports are rendered, set the DoEvents property to True. In this case, you should check the IsBusy property to determine whether the control is busy before telling it to render another report. For example:
Private Sub Form_Load()
vsr.DoEvents = True
End Sub
' this button could be clicked while a report is being rendered
Private Sub Render_Click()
If vsr.IsBusy Then
MsgBox "Please wait until the current report is done."
Else
vsr.Render vp
End If
End Sub
After the report has been rendered into the VSPrinter control, it can be previewed, printed, or saved by the user as any other VSPrinter document.
To render a report directly to a file, use the RenderToFile method instead.