1. Xu YuanYuan
  2. PowerBuilder
  3. Wednesday, 8 February 2023 06:03 AM UTC

Hi All,

I am facing issue with using ole control and insert pdf file to datawindow.

Use below script can not work in the datawindow. 

dw_1.object.ole_1.InsertFile(ls_flie_name)

Appreciate your advice if anyone knew about this issue.

Xu YuanYuan Accepted Answer Pending Moderation
  1. Saturday, 11 February 2023 10:47 AM UTC
  2. PowerBuilder
  3. # 1

Hi Chirs,

 

Noted with Thanks.

 

Best Regards

XuYY

Comment
There are no comments made yet.
Xu YuanYuan Accepted Answer Pending Moderation
  1. Friday, 10 February 2023 01:06 AM UTC
  2. PowerBuilder
  3. # 2

Hi Chris,

 

Thanks for your support.

I have submitted  the support  with attached test app (standardsupport/track/view?id=9744).

Thanks.

 

Best Regards

XuYY

 

Comment
  1. Chris Pollach @Appeon
  2. Friday, 10 February 2023 17:19 PM UTC
Thanks Xu. I see that Ken at Appeon has picked up this ticket.

Apparently, this OLE embedded object within a DWO's methods are not supported.

My suggestion would be to look at the TableBlob feature and see if that might meet your needs.
  1. Helpful
There are no comments made yet.
Xu YuanYuan Accepted Answer Pending Moderation
  1. Thursday, 9 February 2023 04:10 AM UTC
  2. PowerBuilder
  3. # 3

Hi Chris,

 

When set the layer to band. I done the below testing:

1. Please refer to the attachment file (Test1): Add the insert file script to the retrieveend event.  show error message.

2. Please refer to the attachment file (Test2): Remove the retrieveend script and add a button to call the insert file          after report retrieve, no error message, but can not change the pdf file in the OLE control.

 

Best Regards

XuYY

Attachments (2)
Comment
  1. Chris Pollach @Appeon
  2. Thursday, 9 February 2023 14:52 PM UTC
Hi Xu;

Yes, if it's in the "Band" layer (in this case, it looks like your "detail" band) then you need to make sure that AutoSize Height is set for the band and maybe, even the OLE as well in order to display properly.

The error though at the RetrieveEnd event is weird as the OLE control should exist if RowCount() > 1.

Looks like you might have a great test case from what screen captures that you have attached. I would now suggest opening a Support Ticket using this test app as the test case. Then we (Appeon) can look at this in much more detail).

Regards ,... Chris
  1. Helpful
  1. Mark Goldsmith
  2. Friday, 10 February 2023 01:35 AM UTC
Hi Chris...are we sure that should work for an OLE control as part of a DataWindow object as it does for an OLE control on a window? It would be nice if it did but while the OLE control placed on a Window actually has an InsertFile() function available, I don't see the same for a DataWindow control, whether in the Help, the system object Browser or DataWindow Syntax tool. I'm thinking this would explain the error message. Am I missing something?

Regards,

Mark
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 9 February 2023 01:24 AM UTC
  2. PowerBuilder
  3. # 4

Hi Xu;

  Yes, that should work in the DWO the same as a Window. The only considerations would be to make sure that a) there was at least one row in the DWO primary buffer and b) which "band" & "layer" the OLE control is located. The latter might stop the PDF from displaying if too restrictive.

Regards ... Chris 

Comment
There are no comments made yet.
Xu YuanYuan Accepted Answer Pending Moderation
  1. Wednesday, 8 February 2023 23:55 PM UTC
  2. PowerBuilder
  3. # 5

Hi Chris,

 

Thanks for your reply.

Yes. OLE control class is Acrobat PDF reader.

If the OLE control in window, can work normally. ole_1.InsertFile(ls_flie_name)

But if the OLE control in datawindow, can not work. dw_1.object.ole_1.InsertFile(ls_flie_name)

 

Best Regards

XuYY

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 8 February 2023 18:09 PM UTC
  2. PowerBuilder
  3. # 6

Hi Xu;

  What OLE control class is already assigned to your ole_1 object in your DWO?

  Is it the Acrobat PDF reader?

Regards .. Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.