Solved

How can I use CRVEventInfo in Delphi

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

24 Experts available now in Live!

Get 1:1 Help Now