?
Solved

How can I use CRVEventInfo in Delphi

Posted on 2004-10-16
3
Medium Priority
?
312 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
[X]
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
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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…
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 …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

764 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