Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Visual Foxpro and Crystal Report

Posted on 2006-06-26
5
Medium Priority
?
429 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 101

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 101

Accepted Solution

by:
mlmcc earned 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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. …
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

971 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