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

How can I use CRVEventInfo in Delphi

Posted on 2004-10-16
3
309 Views
Last Modified: 2009-07-29
I am using Crystal Report 9 RDC in Delphi 7 with the CRViewer ActiveX for the preview.
I would like to be able to determine the field the user clicked on in the preview window. The OnClick Event looks like this:

procedure TFormPreview.CRViewerClicked(Sender: TObject; x, y: Integer;
  var EventInfo: OleVariant; var UseDefault: WordBool);

I have seen many working exemples of VB code but can't manage to reproduce it under Delphi.

Each time I tried to access the properties:
  EventInfo.text
  EventInfo.type
  EventInfo.GetFields
I get the error "Element not found"

Any help would be welcome.

0
Comment
Question by:pnozay
3 Comments
 

Expert Comment

by:OGURaja
ID: 12327378
I think by using Delphi Activex you cannot trigger any events of the report . You must be using COM Event sink generator tool for Delphi inorder using report events or section formating events.The name of it is Event Sink

refer article c2010927 in Business Objects website
( http://support.businessobjects.com/library/kbase/articles/c2010927.asp ).

I guess this might be useful or may be i am wrong....

-Raja

0
 

Author Comment

by:pnozay
ID: 12330420
Thank you Raja for the propostion.
I tried re-generating the TLB with this tool but it did not solve the issue. Actually the event is triggered so the sink worked. My problem was to interpret the parameter.

By examining the OLEVariant, I finally managed to access the properties:

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;

So I will close this topic.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 12330773
The question has been PAQ'd and the 500 points have been refunded.
RomMod
Community Support Moderator
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

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…
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…

839 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