Solved

Visual Foxpro and Crystal Report

Posted on 2006-06-26
5
392 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
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry.  It may not be possible.  I don't have CR XI so I can't try it.

mlmcc
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

15 Experts available now in Live!

Get 1:1 Help Now