Skip to main content

Uniface Development: [SOLVED] fill ocx container by pdf source

  • November 19, 2018
  • 31 replies
  • 3 views

Show first post

31 replies

Jan Cees Boogaard

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi Dylan, $ocxhandle can only be used after the OCX has been instantiated. And this happens when the form on which the OCX is painted has executed a show, edit or display statement. Hope this helps. Regards, Daniel


Author: diseli (daniel.iseli@uniface.com)

Jan Cees Boogaard

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi, Thank you for your information, I'll try to test it one last question : when I do the display or edit ? Regards, Dylan


Author: Dylan (dylan.huart@gmail.com)

Jan Cees Boogaard

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help
Hi Dylan, This should work:
 

variables HANDLE lh_ocx boolean ln_b endvariables

show

lh_ocx = $ocxhandle ( FIELDOCX.CINOMPJ ) lh_ocx->loadfile( ln_b, "c:\\test2.pdf" )

display

 
And if you want to use display or edit depends on the purpose of the form in question - display: display only, content cannot be changed; edit: content can be changed.
 
Hope this helps.
 
Regards, Daniel

Author: diseli (daniel.iseli@uniface.com)

Jan Cees Boogaard

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Although if your code is in the details trigger of a button, you shouldn't need either the show or display. In fact, I think display has no function outside the exec trigger.  I do believe the thing doesn't work unless in an actual runtime environment, (i.e. not from the test function in the IDF).  Also, ensure you have run the adobe reader on your machine and accepted the licence agreement.  (If running his in debug, what is the status on the loadfile operation)   Iain


Author: Iain Sharp (i.sharp@pcisystems.co.uk)

Jan Cees Boogaard

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

Hi, So, I've successful with a button  from the same "FROM"  without a "display" and "show", but by another "FRM" the problem remains the same : => FRM1 -> click on button -> call FRM2 "execute" ->

variables HANDLE lh_ocx boolean ln_b endvariables

show

lh_ocx = $ocxhandle ( FIELDOCX.CINOMPJ ) lh_ocx->loadfile( ln_b, "c:\\test2.pdf" )

display

I don't understand...   Dylan   Thank you for your help Wink


Author: Dylan (dylan.huart@gmail.com)

Jan Cees Boogaard

[SOLVED] fill ocx container by pdf source

Author: dylan.huart@gmail.com (Dylan)

Hello Wink , I wanted to know how to fill an "OCX​​" by a data source (pdf) stored for example on the c :/ temp I have a FRM which, thanks to a button provides access to the OCX container Thank you for your help

I just indenting my code and ... it works !! this is strange haha..


Author: Dylan (dylan.huart@gmail.com)