1. Steen Jakobsen
  2. PowerBuilder
  3. Wednesday, 25 September 2024 05:35 AM UTC

Hey everyone,

 

is here a way to invoke Windows Forms or WPS ui as part of a PB 2022R3 application ?

My need is to use an Excel Control to be able to view Excel files without having Excel installed.

 

Thanks

//Steen

Aron Cox Accepted Answer Pending Moderation
  1. Saturday, 5 October 2024 16:31 PM UTC
  2. PowerBuilder
  3. # 1

Attached is guide.pdf which details the steps required to build a .NET Framework Windows Forms control as an ActiveX control that can be used in PowerBuilder.

It goes with the example Visual Studio 2022 solution attached to an earlier response on this question.

Attachments (1)
Comment
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Saturday, 5 October 2024 10:07 AM UTC
  2. PowerBuilder
  3. # 2

I have attached a zip file to this response.

It contains a C# .NET Framework Windows Forms project that is an example of wrapping a Window Forms control to build an Active/X control that can be be used as a control in PowerBuilder. There is a PDF file called guide.pdf that details the steps.

I hope it's useful, it's a little arcane, and the wrapping means if you have alof of methods and attribures you want to use from your .NET control there's a bit of work to do, but for me, it has proved very useful.

It's a rushed bit of documentation, but I hope I included all the necessary steps.

Credit should go to Bruce Armstrong who write the orignal artlicel tghat inspired me any years ago.

Let me know if you have any questions :-)

Attachments (1)
Comment
  1. Miguel Leeuwe
  2. Saturday, 5 October 2024 21:02 PM UTC
Thanks. Same question as before: "So this works without having office installed?"
  1. Helpful
  1. Miguel Leeuwe
  2. Saturday, 5 October 2024 21:03 PM UTC
I mean the OP wants to use it to manage XLSX files without Office.
  1. Helpful
  1. Aron Cox
  2. Monday, 7 October 2024 10:03 AM UTC
It depends on the .NET control they want to us. I just provided an example with a basic TextBox control. That would need to be used to create a control using the .NET control the customer has found, that says it can be used to view Excel files. For example:



https://www.spreadsheetgear.com/

https://www.devexpress.com/products/net/controls/winforms/spreadsheet/

https://www.e-iceblue.com/Tutorials/Spire.Spreadsheet/Spire.Spreadsheet-Program-Guide/How-to-Open-and-View-Excel-in-Windows-Form-using-Spire.Speadsheet.html

  1. Helpful
There are no comments made yet.
Aron Cox Accepted Answer Pending Moderation
  1. Thursday, 26 September 2024 07:19 AM UTC
  2. PowerBuilder
  3. # 3

If you know of a .NET control for viewing Excel files then you could COM wrap it and use it as an Active/X control in PowerBuilder, placing it on a window like any other Active/X control. I did this a long time ago to add the Microsoft Chart Controls to a PowerBuilder application, so I know it is possible.

Comment
  1. Aron Cox
  2. Wednesday, 2 October 2024 19:14 PM UTC
I follows soem articles Bruce Armstrong wrote many years ago t oget me up and running, see here:



https://community.appeon.com/index.php/component/tags/tag/com



If you have somewhere I can upload my solution to, happy to share it, as long as you don;t laugh too much at my terrible coding, it was the first .NET thing I wrote!
  1. Helpful
  1. Aron Cox
  2. Thursday, 3 October 2024 10:37 AM UTC
If I have a chance I'll try to knock up a small sample application this weekend, and document some of the main points, so it can be used for any .NET control. Probably Windows Forms and .NET Framework 4.8 based as that's what I used in the past. I'll post here if I manage to get something working. I may be able to upload it somewhere here too, so anyone can find it and give it a go.
  1. Helpful
  1. Arnd Schmidt
  2. Thursday, 3 October 2024 12:42 PM UTC
Hi Aron,

that sounds cool. I am ready to jump in!

regards

Arnd
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 25 September 2024 07:08 AM UTC
  2. PowerBuilder
  3. # 4

Hi,

You could use Google Docs to view them. You set your default to open xlsx with a web browser and there's an extension to make that possible. Later I'll try to tell you which one (when I'm back to work).

Comment
  1. Steen Jakobsen
  2. Tuesday, 1 October 2024 05:06 AM UTC
Thanks Miguel. I my case i'm no allowed to interact with google. But a great suggestion.
  1. Helpful 1
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.