Solved

Visual Foxpro and Crystal Report

Posted on 2006-06-26
5
395 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now