Solved

Visual Foxpro and Crystal Report

Posted on 2006-06-26
5
404 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
[X]
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
  • 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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