VSView Reporting Edition Reference > VSReport Control > VSReport Properties > Cancel Property |
Returns or sets whether to cancel generation of the current report.
[form!]VSReport.Cancel[ = {True | False} ]
Setting this property to True while a report is being generated stops the report generation process. Any pages already created are kept.
This property is typically used to implement a "Cancel" button. For example:
Private Sub Cancel_Click()
If vsr.IsBusy Then
Debug.Print "Cancelling Report"
vsr.Cancel = True
Else
Debug.Print "No report to cancel"
End If
End Sub
You can read the Cancel property to determine whether the report ended normally or was cancelled by the user:
Private Sub vsr_OnClose()
If vsr.Cancel Then
Debug.Print "** The report was Cancelled."
End If
End Sub
In order for the application to process mouse clicks during report generation, the DoEvents property must be set to True.
You can also limit the size of a report using the MaxPages and MaxRecords properties.
Boolean