Skip to main content

[Migrated content. Thread originally posted on 14 January 2005]

About C$GETEVENTPARAM

Hello,

I?m trying to manage the parameters returned by an event fired in the crystal reports ActiveX viewer, but unsuccessfully I can say.

The DEF file of the ActiveX control shows the parameters of the event:


* Clicked
         EVENT, 418, @CrystalActiveXReportViewerClicked
*            4 Parameters
*                "long x"
*                "long y"
*                [b]"VARIANT* EventInfo"[/b]
*                "boolean* UseDefault"


As you can see, the third parameter returns a Variant Type that points to an Object (@CRVEventInfo Object) which I need to process.

What I'm doing is to use "C$GETEVENTPARAM" routine to obtain the values:


...

[b]77  H-EVENTINFO       HANDLE OF @CRVEventInfo.[/b]
77  X-VALUE           PIC 9(05).
77  Y-VALUE           PIC 9(05).
77  RESULT            PIC S9(01).

...

EVALUATE EVENT-DATA-2
   WHEN @CrystalActiveXReportViewerClicked
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "x"          X-VALUE
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "y"          Y-VALUE
        [B]CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-EVENTINFO[/B]
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "UseDefault" RESULT

...



All parameters, except H-EVENTINFO, are properly returned. H-EVENTINFO is always Zero. The problem could be the conversion performed by C$GETEVENTPARAM and C$GETEVENTDATA but I'm unsure about this.

Can someone switch on the bulb ?

Regards.

[Migrated content. Thread originally posted on 14 January 2005]

About C$GETEVENTPARAM

Hello,

I?m trying to manage the parameters returned by an event fired in the crystal reports ActiveX viewer, but unsuccessfully I can say.

The DEF file of the ActiveX control shows the parameters of the event:


* Clicked
         EVENT, 418, @CrystalActiveXReportViewerClicked
*            4 Parameters
*                "long x"
*                "long y"
*                [b]"VARIANT* EventInfo"[/b]
*                "boolean* UseDefault"


As you can see, the third parameter returns a Variant Type that points to an Object (@CRVEventInfo Object) which I need to process.

What I'm doing is to use "C$GETEVENTPARAM" routine to obtain the values:


...

[b]77  H-EVENTINFO       HANDLE OF @CRVEventInfo.[/b]
77  X-VALUE           PIC 9(05).
77  Y-VALUE           PIC 9(05).
77  RESULT            PIC S9(01).

...

EVALUATE EVENT-DATA-2
   WHEN @CrystalActiveXReportViewerClicked
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "x"          X-VALUE
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "y"          Y-VALUE
        [B]CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-EVENTINFO[/B]
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "UseDefault" RESULT

...



All parameters, except H-EVENTINFO, are properly returned. H-EVENTINFO is always Zero. The problem could be the conversion performed by C$GETEVENTPARAM and C$GETEVENTDATA but I'm unsure about this.

Can someone switch on the bulb ?

Regards.
I use C$GETEVENTDATA on similar events and it works ok. I've not used C$GETEVENTPARAM. What version of the runtime are you using? Also, I've learned from the past that it's a good idea to initialize the fields before calling C$GETEVENTDATA.

Haven't had this specific experience before.

Rob

[Migrated content. Thread originally posted on 14 January 2005]

About C$GETEVENTPARAM

Hello,

I?m trying to manage the parameters returned by an event fired in the crystal reports ActiveX viewer, but unsuccessfully I can say.

The DEF file of the ActiveX control shows the parameters of the event:


* Clicked
         EVENT, 418, @CrystalActiveXReportViewerClicked
*            4 Parameters
*                "long x"
*                "long y"
*                [b]"VARIANT* EventInfo"[/b]
*                "boolean* UseDefault"


As you can see, the third parameter returns a Variant Type that points to an Object (@CRVEventInfo Object) which I need to process.

What I'm doing is to use "C$GETEVENTPARAM" routine to obtain the values:


...

[b]77  H-EVENTINFO       HANDLE OF @CRVEventInfo.[/b]
77  X-VALUE           PIC 9(05).
77  Y-VALUE           PIC 9(05).
77  RESULT            PIC S9(01).

...

EVALUATE EVENT-DATA-2
   WHEN @CrystalActiveXReportViewerClicked
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "x"          X-VALUE
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "y"          Y-VALUE
        [B]CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-EVENTINFO[/B]
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "UseDefault" RESULT

...



All parameters, except H-EVENTINFO, are properly returned. H-EVENTINFO is always Zero. The problem could be the conversion performed by C$GETEVENTPARAM and C$GETEVENTDATA but I'm unsure about this.

Can someone switch on the bulb ?

Regards.
Originally posted by Robstan
I use C$GETEVENTDATA on similar events and it works ok. I've not used C$GETEVENTPARAM.


I've used both C$GETEVENTDATA and C$GETEVENTPARAM with identical results. Anyway C$GETEVENTPARAM allows access to a single parameter and also makes a more readable code.

Originally posted by Robstan
What version of the runtime are you using?


6.2 (impatient until version 7 beta appears).

Originally posted by Robstan
Also, I've learned from the past that it's a good idea to initialize the fields before calling C$GETEVENTDATA.


Also I've tried to first initialize the fields without success.

Thanks.

[Migrated content. Thread originally posted on 14 January 2005]

About C$GETEVENTPARAM

Hello,

I?m trying to manage the parameters returned by an event fired in the crystal reports ActiveX viewer, but unsuccessfully I can say.

The DEF file of the ActiveX control shows the parameters of the event:


* Clicked
         EVENT, 418, @CrystalActiveXReportViewerClicked
*            4 Parameters
*                "long x"
*                "long y"
*                [b]"VARIANT* EventInfo"[/b]
*                "boolean* UseDefault"


As you can see, the third parameter returns a Variant Type that points to an Object (@CRVEventInfo Object) which I need to process.

What I'm doing is to use "C$GETEVENTPARAM" routine to obtain the values:


...

[b]77  H-EVENTINFO       HANDLE OF @CRVEventInfo.[/b]
77  X-VALUE           PIC 9(05).
77  Y-VALUE           PIC 9(05).
77  RESULT            PIC S9(01).

...

EVALUATE EVENT-DATA-2
   WHEN @CrystalActiveXReportViewerClicked
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "x"          X-VALUE
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "y"          Y-VALUE
        [B]CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-EVENTINFO[/B]
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "UseDefault" RESULT

...



All parameters, except H-EVENTINFO, are properly returned. H-EVENTINFO is always Zero. The problem could be the conversion performed by C$GETEVENTPARAM and C$GETEVENTDATA but I'm unsure about this.

Can someone switch on the bulb ?

Regards.
Note that EventInfo is wrapped by a variant. May I suggest you return this value into a USAGE VARIANT and then try to use C$GETVARIANT to get the handle to EventInfo.

[Migrated content. Thread originally posted on 14 January 2005]

About C$GETEVENTPARAM

Hello,

I?m trying to manage the parameters returned by an event fired in the crystal reports ActiveX viewer, but unsuccessfully I can say.

The DEF file of the ActiveX control shows the parameters of the event:


* Clicked
         EVENT, 418, @CrystalActiveXReportViewerClicked
*            4 Parameters
*                "long x"
*                "long y"
*                [b]"VARIANT* EventInfo"[/b]
*                "boolean* UseDefault"


As you can see, the third parameter returns a Variant Type that points to an Object (@CRVEventInfo Object) which I need to process.

What I'm doing is to use "C$GETEVENTPARAM" routine to obtain the values:


...

[b]77  H-EVENTINFO       HANDLE OF @CRVEventInfo.[/b]
77  X-VALUE           PIC 9(05).
77  Y-VALUE           PIC 9(05).
77  RESULT            PIC S9(01).

...

EVALUATE EVENT-DATA-2
   WHEN @CrystalActiveXReportViewerClicked
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "x"          X-VALUE
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "y"          Y-VALUE
        [B]CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-EVENTINFO[/B]
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "UseDefault" RESULT

...



All parameters, except H-EVENTINFO, are properly returned. H-EVENTINFO is always Zero. The problem could be the conversion performed by C$GETEVENTPARAM and C$GETEVENTDATA but I'm unsure about this.

Can someone switch on the bulb ?

Regards.
I've already tried this:


...
77  H-VARIANT         HANDLE OF VARIANT.
77  H-EVENTINFO       HANDLE OF @CRVEventInfo.
...
CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-VARIANT

CALL "C$GETVARIANT USING
          H-VARIANT H-EVENTINFO


but what I'm getting is an error message:

Invalid or missing parameter to "C$GETVARIANT"

What do you think ?

[Migrated content. Thread originally posted on 14 January 2005]

About C$GETEVENTPARAM

Hello,

I?m trying to manage the parameters returned by an event fired in the crystal reports ActiveX viewer, but unsuccessfully I can say.

The DEF file of the ActiveX control shows the parameters of the event:


* Clicked
         EVENT, 418, @CrystalActiveXReportViewerClicked
*            4 Parameters
*                "long x"
*                "long y"
*                [b]"VARIANT* EventInfo"[/b]
*                "boolean* UseDefault"


As you can see, the third parameter returns a Variant Type that points to an Object (@CRVEventInfo Object) which I need to process.

What I'm doing is to use "C$GETEVENTPARAM" routine to obtain the values:


...

[b]77  H-EVENTINFO       HANDLE OF @CRVEventInfo.[/b]
77  X-VALUE           PIC 9(05).
77  Y-VALUE           PIC 9(05).
77  RESULT            PIC S9(01).

...

EVALUATE EVENT-DATA-2
   WHEN @CrystalActiveXReportViewerClicked
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "x"          X-VALUE
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "y"          Y-VALUE
        [B]CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "EventInfo"  H-EVENTINFO[/B]
        CALL "C$GETEVENTPARAM" USING
             EVENT-CONTROL-HANDLE "UseDefault" RESULT

...



All parameters, except H-EVENTINFO, are properly returned. H-EVENTINFO is always Zero. The problem could be the conversion performed by C$GETEVENTPARAM and C$GETEVENTDATA but I'm unsure about this.

Can someone switch on the bulb ?

Regards.
In the previous example, seems like "C$GETVARIANT" is failing due to H-VARIANT is null. In fact, if I code this way:

IF H-VARIANT NOT = NULL
   CALL "C$GETVARIANT USING
        H-VARIANT H-EVENTINFO
END-IF

no error occurs.

Now the question is: Is Crystal returning mistakely the "EventInfo" Variant or is "C$GETEVENTPARAM" failing to get it ?

Here is the coding in VB (that works) for the Cliked Event:


Private Sub CrystalViewer1_Clicked(ByVal x As Long, ByVal y As Long, EventInfo As Variant, UseDefault As Boolean)

'Create an object that traps the CRViewer event info.
Dim CrViewerEventInfo As CrystalActiveXReportViewerLib10Ctl.CRVEventInfo

'Pass the EventInfo info to the CrVEventInfo object.
Set CrViewerEventInfo = EventInfo

'If the event text is not empty then display it in a Message Box.
If Not CrViewerEventInfo.Text = "" Then
   MsgBox CrViewerEventInfo.Text
End If

End Sub


I hope this make things more clear.
Regards.