Solved

How can I use CRVEventInfo in Delphi

Posted on 2004-10-16
3
307 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

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

20 Experts available now in Live!

Get 1:1 Help Now