Tech Articles


Call WCF Services Using HTTPClient or RESTClient Objects


Background

Prior to PowerBuilder 2017 R2, the SoapClient did not support calling WCF Services.

In PowerBuilder 2017 R2 and the latter versions, the HTTPClient object is available, through which you can call WCF Services.

In PowerBuilder 2019, the RESTClient object is strengthened, now you can also call the WCF Services.

 

How to use HTTPClient object to consume a WCF Service

      a. To get the methods and parameters to consume the WCF Service.

Normally when you open a WCF Service website, you will get the following page:

Read more

Exporting Datawindows to Excel / Html without losing Format


I have a function called "GuardarAExcel2()" which uses a step datawindow called "d_filafichero". With this function you generate an excel with the same visual aspect as your datawindow. I hope it helps you:

Example of use:

GuardarAExcel2( dw_1, "c:\Report.xls")
GuardarAExcel2( dw_1, "c:\Report.html")

Result in datawindow:

 

Read more

Enabling Drag & Drop from Outlook


Enabling Drag & Drop from Outlook to PB using a 3rd Party (free) DLL

 

While trying to find a solution on how to be able to do a drag & drop from outlook into PB, I did find a DLL library from a 3rd party. The DLL was free to use (source code available to purchase) and it worked bot in x32 and x64 environments.

The reason why I'm posting this is that while searching from the internet for a solution, I didn't find that many useful pages. After two days of searching, I stumbled on this and thought thet other PB users can benefit from this.

The link to the DLL site is here https://www.catsoft.ch/#download

and on the page look for "Drag & Drop in PowerBuilder"

I have now other association to the 3rd party, other than that I use the DLL. I also askes permission for the posting from the 3rd party.

I'm happy with the DLL, and the users of our product also like the possibility to drag & drop emails or just a sibgle attachemnt, directly from Outlook to the PB application.

 

Kari

 

NULL Handling in C# vs. PowerScript/SQL


C# handles NULL quite different than PowerScript and SQL.
Same code in PowerScript and C# may have different outcome.

 

Read more

Implementing OAuth 2.0 Authorization with PowerBuilder 2019 R2


Introduction

PowerBuilder supports getting secured data from the OAuth 2.0 authorization server. The Bearer access token is supported, and the following grant types are supported:

  • Authorization Code
  • Implicit Flow
  • Client Credentials
  • Extension (or Refresh Token)
  • Resource Owner Password

This document provides an example on how to set up OAuth 2.0 authorization workflow using the Authorization Code grant type in a PowerBuilder application.

Read more

How to Define Events for RibbonBar Controls


Learning to define user events for items in the RibbonBar control feels like a lot of trial and error.
Different items support different events. Same event type requires different parameters.
My aim with this article is to take "... and error" out of your RibbonBar coding.
For each ribbon item type you get user event definitions that work.

 

 

      

Each ribbon item has its own XML element (here: Print Title is a CheckBox).
Each item binds specific user events via properties (here: Clicked on CheckBox binds to ue_PrintTitle)
Each user event must have the correct parameter list (here: Clicked event for CheckBox always requires al_handle while no other parameters allowed)
Each item type has its own PowerScript class and functions to obtain the object (here: Obtain class = RibbonCheckBoxItem via function GetCheckBox)
 

Read more

Enhanced JSON handling


Why enhance JSON handling?

Reading and writing JSON in PowerBuilder is simple using PowerBuilder’s RESTClient object; however, the JSON needs to be in a two-dimensional format. But there are times when the JSON you are working with has multiple nested levels, especially if working with data from an external interface not under your control.

The PowerBuilder objects JSONParser and JSONGenerator can be used to parse or generate such JSON with multiple nested levels.  However, a key caveat is that the JSONParser and JSONGenerator require the JSON data to be accessed through “handles”.  For example, the getItemObject() returns a handle rather than the full JSON object.  Compared to an object-based approach, this handle-based approach requires more coding by the developer.

Read more

Find Articles by Tag

Database Painter Text Encryption C# UI Modernization TreeView Database SQL Repository DataType DLL PFC Database Table Schema Validation OLE Export JSON Windows 10 Icons Migration Testing Export JSON 64-bit Syntax .NET Assembly Deployment Import WinAPI PowerScript (PS) PowerBuilder Compiler Interface CoderObject CI/CD Charts iOS PowerServer Mobile SQL Server Open Source SVN API Automated Testing Authentication SnapDevelop Icon Variable InfoMaker Web Service Proxy Git Authorization License Menu Filter RichTextEdit Control Class Service REST OAuth Oracle SqlModelMapper WebBrowser Array Platform DevOps Bug Jenkins Installation Debug Excel MessageBox Script RibbonBar Builder Encoding OAuth 2.0 TortoiseGit PostgreSQL ODBC driver TFS Application Database Profile Resize Sort Source Code Elevate Conference Event Handler Graph PBDOM BLOB SOAP Error Android SqlExecutor Configuration DragDrop SDK Expression PowerServer Web RESTClient Linux OS Branch & Merge UI PostgreSQL Trial Window Windows OS RibbonBar Design Model File .NET DataStore NativePDF JSONParser Import JSON Event Handling .NET Std Framework GhostScript Transaction Azure Database Table Data DataWindow Performance UI Themes Messagging ActiveX Debugging PowerBuilder Database Connection Web API CrypterObject 32-bit Mobile Stored Procedure Outlook COM PowerBuilder (Appeon) JSONGenerator External Functions Source Control Database Object ODBC PDF Database Table Data PDFlib Event SnapObjects XML IDE Debugger TLS/SSL DataWindow JSON OrcaScript HTTPClient