Topics

Testing libraries with ActiveX and Crystal Reports XI

Humberto C
 

Hello everyone,
I am testing Activex controls with Crystal Reports, since UniPaaS I have had some headaches and I want to try Magic XPA from 2.0 or Magic XPA 2.2, where I could download these installers…

SingleUserEdition.


Thank you,
Humberto.

Andy Jerison
 

Xpa does not support ActiveX controls.

Andy 

On Wed, May 13, 2020, 18:31 Humberto C via groups.io <humberto_c63=yahoo.com@groups.io> wrote:
Hello everyone,
I am testing Activex controls with Crystal Reports, since UniPaaS I have had some headaches and I want to try Magic XPA from 2.0 or Magic XPA 2.2, where I could download these installers…

SingleUserEdition.


Thank you,
Humberto.

Humberto C
 

Well, I was testing UniPaaS ActiveX controls for general Reports with the utility (Crystal Rports ActiveX Designer Run Time Library 11.0) Verb.0. And not with good results….

El miércoles, 13 de mayo de 2020 06:29:14 p. m. GMT-5, Andy Jerison <droidaj@...> escribió:


Xpa does not support ActiveX controls.

Andy 

On Wed, May 13, 2020, 18:31 Humberto C via groups.io <humberto_c63=yahoo.com@groups.io> wrote:
Hello everyone,
I am testing Activex controls with Crystal Reports, since UniPaaS I have had some headaches and I want to try Magic XPA from 2.0 or Magic XPA 2.2, where I could download these installers…

SingleUserEdition.


Thank you,
Humberto.

Steven Blank
 

Humberto,

If your goal is to get CRAX working with uniPaaS v1.9, I can probably help you with that.

What, exactly, are your headaches?

Steve Blank

On 5/14/2020 8:48 AM, Humberto C via groups.io wrote:
Well, I was testing UniPaaS ActiveX controls for general Reports with the utility (Crystal Rports ActiveX Designer Run Time Library 11.0) Verb.0. And not with good results….

El miércoles, 13 de mayo de 2020 06:29:14 p. m. GMT-5, Andy Jerison <droidaj@...> escribió:


Xpa does not support ActiveX controls.

Andy 

On Wed, May 13, 2020, 18:31 Humberto C via groups.io <humberto_c63=yahoo.com@groups.io> wrote:
Hello everyone,
I am testing Activex controls with Crystal Reports, since UniPaaS I have had some headaches and I want to try Magic XPA from 2.0 or Magic XPA 2.2, where I could download these installers…

SingleUserEdition.


Thank you,
Humberto.

przemm@...
 

Hi,

With respect to running Activex'es within XPA there is a Microsoft utility called AXIMP.EXE that generates .NET control wrappers for Activex controls.

For my very simple three Activex controls I've recently generated those wrappers and they seem to work all right in XPA v.2 ..

If anyone is interested I can share details .

BR
Przemek

Humberto C
 

Thank you,
for sharing your experience with AXIMP.EXE

Slds,
Humberto

El viernes, 15 de mayo de 2020 02:54:57 a. m. GMT-5, <przemm@...> escribió:


Hi,

With respect to running Activex'es within XPA there is a Microsoft utility called AXIMP.EXE that generates .NET control wrappers for Activex controls.

For my very simple three Activex controls I've recently generated those wrappers and they seem to work all right in XPA v.2 ..

If anyone is interested I can share details .

BR
Przemek

przemm@...
 

OK,


Suppose you have an OCX you would like to generate a .NET wrapper for and this OCX is PRISMVW.OCX and it is located in ,say, C:\IBIZA\OCX .

For this you need AXIMP.EXE tool . Find it on disk.
If it’s not there I think you should install free Visual Studio Community Edition ( like VS 2019).

For simplicity then copy this AXIMP.EXE to your equivalent of C:\IBIZA\OCX.

Open command prompt (CMD) and CD to your equivalent of C:\IBIZA\OCX in the prompt.

Type: AXIMP  <yourocxfile>  and hit ENTER  .

Eg in my case: AXIMP PRISMVW.OCX  <ENTER>

 

If all is ok , two new DLL files will be generated – in my case PRISMVWLib.DLL and AxPRISMVWLib.DLL

These are the .Net wrapper for this single OCX . You will need 2 DLL’s for every OCX you want to wrap.

 

You should copy those 2 files to a main XPA directory, the one that contains MGXPARuntime.EXE. Both development installation , and for every customer installation.

 

Now you should reference those 2 DLL’s in Magic CRR  in your application ( what used to be under Shift-F7 in uniPaas ), type .Net. Also you have to reference some additional .Net libraries for the wrapper to work .

 

Below is a list of all .NET references that I settled on , by trial and error, some are possibly not needed , but hey , it works.

System.Windows.Forms

System.ComponentModel

System.ComponentModel.Annotations

System.ComponentModel.Composition

System.ComponentModel.DataAnnotations

System.ComponentModel.EventBasedAsync

System.ComponentModel.Primitives

System.ComponentModel.TypeConverter

System

netstandard

 

Add to that list both of the new DLL’s.

1.       Add new line , choose type .NET , the .Net Assembly Selection dialog window will open.
2.   Choose Browse tab
3.       Choose first DLL file , from your Magic directory , click OK
4.       Repeat 1-3 for the other DLL

 

 

Now comes the hard part , blood , sweat and tears . 😉  You have to rip out anything that handles OCX and put in it’s place new and shiny .Net control stuff  - for every occurrence of the OCX in your forms .

For every OCX placed on the form you have to :

1.       Add variable of type .Net
2.       Go to its properties , to Object Type , start typing by typing A . A list of various types opens and you can select your desired control  ( in my case AxPRISMVWLib ) . Then when you have it in property field , type dot and then another list appears of subtypes and I choose AxPrismVw , so all in all I have ObjectType = AxPRISMVWLib.AxPrismVW
3.       Put a .NET widget on you form  ( the one with blue ball, green something and red cube) , at least this is what I chose in XPA v2
4.       Open it’s property list , find a property called .Net Object , zoom there and choose your .Net variable. Let’s say it is variable with Magic code BE.
5.       Then you have to replace each and every Invoke COM with .NET equivalent , the funniest part.
Say , I had Invoke COM , Method SetZoomPercent , with single parameter in parameter table
Now I can replace it with following expression: BE.SetZoomPercent(CB)
It is quite neat: you type BE (as in your .net var code ) and dot – and list of valid methods appears , you choose one and then you even have tooltips about possible parameters so it’s not all horrible.

In harder cases you could Invoke .NET and create C# snippet instead.

6.       In theory you can even capture events ( as type .Net) , but I didn’t really use it .

 

 

For my simple use case it was sufficient .

If you have problems with the above , ask questions , I will do my best to help , though I still learn XPA and C#

Hope this helps someone
Przemek

Humberto C
 

Thank you,
Humberto

El sábado, 16 de mayo de 2020 04:53:21 p. m. GMT-5, <przemm@...> escribió:


OK,


Suppose you have an OCX you would like to generate a .NET wrapper for and this OCX is PRISMVW.OCX and it is located in ,say, C:\IBIZA\OCX .

For this you need AXIMP.EXE tool . Find it on disk.
If it’s not there I think you should install free Visual Studio Community Edition ( like VS 2019).

For simplicity then copy this AXIMP.EXE to your equivalent of C:\IBIZA\OCX.

Open command prompt (CMD) and CD to your equivalent of C:\IBIZA\OCX in the prompt.

Type: AXIMP  <yourocxfile>  and hit ENTER  .

Eg in my case: AXIMP PRISMVW.OCX  <ENTER>

 

If all is ok , two new DLL files will be generated – in my case PRISMVWLib.DLL and AxPRISMVWLib.DLL

These are the .Net wrapper for this single OCX . You will need 2 DLL’s for every OCX you want to wrap.

 

You should copy those 2 files to a main XPA directory, the one that contains MGXPARuntime.EXE. Both development installation , and for every customer installation.

 

Now you should reference those 2 DLL’s in Magic CRR  in your application ( what used to be under Shift-F7 in uniPaas ), type .Net. Also you have to reference some additional .Net libraries for the wrapper to work .

 

Below is a list of all .NET references that I settled on , by trial and error, some are possibly not needed , but hey , it works.

System.Windows.Forms

System.ComponentModel

System.ComponentModel.Annotations

System.ComponentModel.Composition

System.ComponentModel.DataAnnotations

System.ComponentModel.EventBasedAsync

System.ComponentModel.Primitives

System.ComponentModel.TypeConverter

System

netstandard

 

Add to that list both of the new DLL’s.

1.       Add new line , choose type .NET , the .Net Assembly Selection dialog window will open.
2.   Choose Browse tab
3.       Choose first DLL file , from your Magic directory , click OK
4.       Repeat 1-3 for the other DLL

 

 

Now comes the hard part , blood , sweat and tears . 😉  You have to rip out anything that handles OCX and put in it’s place new and shiny .Net control stuff  - for every occurrence of the OCX in your forms .

For every OCX placed on the form you have to :

1.       Add variable of type .Net
2.       Go to its properties , to Object Type , start typing by typing A . A list of various types opens and you can select your desired control  ( in my case AxPRISMVWLib ) . Then when you have it in property field , type dot and then another list appears of subtypes and I choose AxPrismVw , so all in all I have ObjectType = AxPRISMVWLib.AxPrismVW
3.       Put a .NET widget on you form  ( the one with blue ball, green something and red cube) , at least this is what I chose in XPA v2
4.       Open it’s property list , find a property called .Net Object , zoom there and choose your .Net variable. Let’s say it is variable with Magic code BE.
5.       Then you have to replace each and every Invoke COM with .NET equivalent , the funniest part.
Say , I had Invoke COM , Method SetZoomPercent , with single parameter in parameter table
Now I can replace it with following expression: BE.SetZoomPercent(CB)
It is quite neat: you type BE (as in your .net var code ) and dot – and list of valid methods appears , you choose one and then you even have tooltips about possible parameters so it’s not all horrible.

In harder cases you could Invoke .NET and create C# snippet instead.

6.       In theory you can even capture events ( as type .Net) , but I didn’t really use it .

 

 

For my simple use case it was sufficient .

If you have problems with the above , ask questions , I will do my best to help , though I still learn XPA and C#

Hope this helps someone
Przemek