1680653 - How to show Crystal Reports Alerts when using the CrystalReportViewer for VS .NET

SAP Knowledge Base Article - Public

1680653 - How to show Crystal Reports Alerts when using the CrystalReportViewer for VS .NET

Symptom

  • A report that contains Alerts works as expected when used in Business Objects Enterprise and the SAP Crystal Reports Designer
  • The report does not alert when running in a VS .NET application

Environment

  • Crystal Reports for Visual Studio 2010
  • Visual Studio 2010

Resolution

  • Use the InProc RAS APIs:
rpt.Load(@"c:\customer\alerting.rpt");
rcd = rpt.ReportClientDocument;
Alerts alerts;
alerts = rcd.SearchController.GetTriggeredAlerts();
if (alerts.Count > 0)
{
foreach (Alert alert in alerts)
{
string alertinfo = string.Empty;
alertinfo = "Alert Name: " + alert.Name + "\n\r";
alertinfo += "Alert Message: " + alert.Message.ToString() + "\n\r";
alertinfo += "Alert Formula: " + alert.MessageFormula.Text.ToString() + "\n\r";
MessageBox.Show(alertinfo.ToString()); 
}
}

Keywords

CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 notify , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio