cancel
Showing results for 
Search instead for 
Did you mean: 

Report Alerts Not Firing From VB6

Former Member
0 Kudos

I use Crystal Reports 11.5.12.1838. When I run the reports from the designer everything works fine but when I run them from VB6 the alerts are not firing. Any idea what might be a problem?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

The search string 'crystal alert rdc' (search box in top right corner) returns the following KBA as the second hit:

1214573 - How do you use Report Alerts with the Report Designer Component?

Please see if that will help.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

That worked. Thanks.

By the way, I had to change the code in the following way to trap the alert embeded in one of the subreports:

Private Sub CheckAlertsIn(rept As CRAXDDRT.report)

    Dim reptSection As CRAXDDRT.Section

 

    WaitForFinishLoading

    For Each reptSection In rept.Sections

        CheckAlertsInSection reptSection

    Next

End Sub

Private Sub WaitForFinishLoading()

    Do While Me.ReportViewer.IsBusy

        DoEvents

        Sleep 100

    Loop

End Sub

Private Sub CheckAlertsInSection(sect As CRAXDDRT.Section)

    Dim reptObject As Object

 

    For Each reptObject In sect.ReportObjects

        CheckIfIsSubreport reptObject

    Next

End Sub

Private Sub CheckIfIsSubreport(reptObject As Object)

    If reptObject.Kind = CRAXDDRT.crSubreportObject Then

        CheckIfHasAlerts reptObject.OpenSubreport

    End If

End Sub

Private Sub CheckIfHasAlerts(subreport As CRAXDDRT.report)

    Dim alert As CRAXDDRT.ReportAlert

 

    For Each alert In subreport.ReportAlerts

        CheckAlert alert

    Next

End Sub

Private Sub CheckAlert(alert As CRAXDDRT.ReportAlert)

    Dim alertInstance As CRAXDDRT.ReportAlertInstance

 

    For Each alertInstance In alert.AlertInstances

        MsgBox alertInstance.AlertMessage, vbInformation, "Report Alert"

    Next

End Sub

former_member183750
Active Contributor
0 Kudos

Excellent and many thanks for the additional info.

- Ludek

Answers (0)