Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Visual Foxpro and Crystal Report

Posted on 2006-06-26
5
403 Views
Last Modified: 2009-12-16
I would like to determine the field the user clicked on a Crystal Report XI preview control.
I am using Visual Foxpro 9.

The method of the Clicked event looks like this:

*** ActiveX Control Event ***
LPARAMETERS x, y, eventinfo, usedefault
LOCAL aaa AS CrystalActiveXReportView.CRVEventInfo
aaa = eventinfo

When I try to access any members of aaa object I get the message:

OLE error code 0x8002802b: Element not found.

Can anyone help ?
0
Comment
Question by:pionier
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 16989545
I am not sure that you can do that.

do the fields have click events themselves or there only a click event on the report?

mlmcc
0
 

Author Comment

by:pionier
ID: 16999616
mlmcc,

The click event in on the report.

When event fires, I can access x and y values, but cannot access  
EventInfo object properties and methods. In the debbuger the watch  
shows that EventInfo is "(Object)", its type is "O". But there are no  
properties shown there.  
 
On BusinessObjects site there is an example in Visual Basic wich seems to work:

Dim myField As CRVIEWERLibCtl.CRField
Dim myFields As CRVIEWERLibCtl.CRFields
Dim myEventInfo As CRVIEWERLibCtl.CRVEventInfo

Private Sub CRViewer1_Clicked(ByVal x As Long, ByVal y As Long, EventInfo As Variant, UseDefault As Boolean)
Dim numIndex As Long

'Set the EventInfo object to trap the CRviewer event such as click in this case:
Set myEventInfo = EventInfo

'Set the fields collections of the report:
Set myFields = myEventInfo.GetFields

'Assign the index that the user is clicked on:
numIndex = myFields.SelectedFieldIndex

'If the user didn't click on right spot, exit sub:
If numIndex = 0 Then Exit Sub

'Assign the field object to the one clicked on:
Set myField = myFields.Item(numIndex)

'Shows the clicked field name:
MsgBox myField.Name

'Shows the field value(content):
MsgBox myField.Value

End Sub

And I found another example in Delphi:

procedure TFormPreview.CRViewerClicked(Sender: TObject; x, y: Integer;
  var EventInfo: OleVariant; var UseDefault: WordBool);
var
  interf : ICRVEventInfo;
  s : string;
begin
  interf := ICRVEventInfo(TVarData(EventInfo).VUnknown);
  s := interf.Text;



0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 17006826
Sorry.  It may not be possible.  I don't have CR XI so I can't try it.

mlmcc
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question