Kbase P114017: Error 5890 using the SearchForText method of the Crystal ActiveX Report Viewer Control 11.0
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  3/7/2006 |
|
Status: Unverified
FACT(s) (Environment):
Crystal Reports 11 (XI)
Windows
SYMPTOM(s):
Using the Crystal ActiveX Report Viewer control
Using the SearchForText method
The message "The text cannot be found in the report" is generated by the Viewer control once the last record matching the search criteria has been found
Error 5890 is displayed after the message from the Viewer control
Error occurred while accessing component property/method: <property or method name>.
<COM message>
Error code: <Program name> (5890)
Error occurred while accessing component property/method: SearchForText.
Exception occurred
Error code: 0x80020009 <Program name> (5890)
Application continues to operate normally after clicking OK on the 5890 error
No error is seen testing with the same code in Crystal Reports 9
No error is seen testing with the same code in Crystal Reports 10
Testing with Visual Basic 6 sample code using the SearchForText method also generates an error
Runtime error '-2147483638 (8000000a)':
Method 'SearchForText' of object 'ICrystalReportViewer11' failed
CHANGE:
Upgraded to Crystal Reports XI
CAUSE:
This issue appears to be a bug in the Crystal ActiveX Report Viewer Control 11.0. The issue is reproducible in both the Progress ABL and Visual Basic 6. The problem did not occur in previous versions of Crystal Reports.
For further information, customers should contact Business Objects Technical Support.
FIX:
Option #1
Use NO-ERROR to suppress the 5890 error. This appears to have no adverse effects and the application will continue to work as normal.
The following sample code checks that the report has been generated and then calls the SearchForText method:
/* Sample Code */
IF chCtrlFrame:CrystalActiveXReportViewer:ReportSource > 0 THEN
IF Fill-in-1:SCREEN-VALUE <> "" THEN
chCtrlFrame:CrystalActiveXReportViewer:SearchForText(fill-in-1:SCREEN-VALUE) NO-ERROR.
ELSE
MESSAGE "No search text has been entered"
VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Generate report before trying to search"
VIEW-AS ALERT-BOX.
Option #2
Enable the built-in search control of the Crystal ActiveX Report Viewer Control 11.0 by setting the EnableSearchControl property to True. This can be done either by double-clicking on the control and manually setting the property at design time or programmatically. For example:
chCtrlFrame:CrystalActiveXReportViewer:EnableSearchControl = True.