Solved

How can I use CRVEventInfo in Delphi

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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. …
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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