Welcome!

Related Topics: PowerBuilder

PowerBuilder: Article

The Little PowerBuilder App that Grew

PowerBuilder provides a powerful environment for creating end-user applications whose primary purpose is data entry & reporting

This article will describe the development of a fairly large (over 4,000 users) one-man software business, selling an application developed with PowerBuilder. I'll touch on a number of technical issues I encountered in the development of the program and the business.

How the Business Got Started
The DONATION program is used by small to mid-sized charities and churches, mostly in North America, to track their donors and donations, and to issue charitable receipts. The first version was actually written in C, in 1994, to fill a gap at my own Quaker Meeting, after a commercial program we had bought started falling apart (no referential integrity). I decided I could write something better. By 1999, it was time to create a Windows version, and the PowerBuilder version was born.

Having put so much work into it by this time, I felt there was no point having only one organization use it, so I put it up for free download and use on a web site. At that point I had a regular programming job and had no desire to make a business out of it. A few years later, I started inviting voluntary contributions for it, but that never did any more than pay my expenses for hosting, software, etc. After 8 years of giving it away for free, there were over 4,000 users.

In 2007, I thought I would like to open source the application, partly to provide a way for it to continue to exist if anything should happen to me, like being run over by a truck! PowerBuilder did not seem ideal for an open source app - too few programmers, plus it's a bit expensive. So, I took a three-month leave of absence from my job, and started a .NET port.

Two months in, I was less than halfway done, and could see that although .NET's database access capabilities had improved significantly, they were nowhere near matching PowerBuilder's. Visual Studio didn't even include a report builder whose runtime could be distributed as part of an open source app. So, after serious reflection, I decided to abandon the port (and the open source idea), go back and continue development with PowerBuilder, quit my job, and start a business with DONATION. I was so relieved to have a powerful, comprehensive and fast development environment back, not to mention one where I didn't have to wait for compiles to test small changes.

The business was launched by announcing to all users that while they were welcome to keep using their current versions for free, future upgrades and support would require a small payment, with a discount being given to existing users. Fortunately, many users paid right away, and the business continued to grow from there.

Issues with SQL Anywhere / Adaptive Server Anywhere
For quite a few years, the program used Sybase SQL Anywhere / ASA as its database. It was in most respects perfect for this use - a great embedded DB, requiring no administration, and rock solid. However, there were two problems.

The first was that the runtime version that could be freely distributed with PowerBuilder applications did not allow any Data Definition Language to be used. As a result, any time I had to make changes to the database structure, like adding new fields to tables, I had to go through a rather convoluted and scary process. First, create a new empty database with the new fields. Then, add code to the program, using Pipelines, to convert from the previous database structure to the new one. Finally, make a new version of my installer that installed the new empty database, and have the first run of the application do the conversion.

Although I could have sold copies of the full ASA to users to eliminate this limitation, this was not an option when the program was free. Even when the program became commercial, the price was so low that adding in the price of an ASA license did not seem to be a reasonable option. (Plus, it would have eliminated the option of giving a free 60-day evaluation period, which I do.)

The other problem was an odd one. Periodically, users' ODBC data sources that had been installed by the program's installer for the ASA DB just stopped working, for no apparent reason. Deleting the data sources and rerunning the installer sometimes fixed it, and sometimes didn't. Sometimes, the information about the driver also had to be removed directly using the Registry Editor before a reinstall would fix it. And very occasionally, nothing I could do would fix it, and the user would have to give up and use the app on a different computer.

Taking these two points together, I finally decided as part of a significant relaunch after abandoning the .NET port to switch to an open source DB with an embedded option. I chose Firebird SQL. It has proven to be a very capable and solid database, though its SQL dialect does have a few weaknesses in comparison to that of SQL Anywhere, such as far fewer built-in functions. Also, it does not support UPDATE statements with FROM clauses, so UPDATEs involving data from multiple tables have to use subqueries as columns' values. The server version of Firebird was also eventually used to provide a multi-user version of DONATION.

Working Around Some PowerBuilder Limitations
DONATION uses PowerBuilder's built-in DataWindow (DW) Sort and Filter dialogs, and until recently also used its DW SaveAs dialog, to give users these capabilities. You can specify a help file and help topic to be used in a Help button on those dialogs, which is extremely helpful since they are a bit techie for end users. Unfortunately, only old-style WinHelp files (*.hlp) can be used, not the more modern HTML Help (*.chm) files. Starting in Windows Vista, Windows no longer comes by default with the capability to display WinHelp files. I am a bit amazed that this still has not been fixed in PowerBuilder, despite being identified as a problem quite a few versions ago. As a result, I have to distribute both a WinHelp help file (for use in those three dialogs) and an HTML Help file (for use everywhere else in the program) with my application.

An annoying weakness of the DW SaveAs dialog is that it doesn't return the filename or file type that the user saved. As a result, it's impossible for an app to do things like offer to open a file saved in Excel format in Excel for the user. Also, if you aren't using one of PowerBuilder's two ways of saving PDF files, the PDF SaveAs option just silently fails. Providing my own SaveAs window allowed me to limit the types to those that I thought would most likely be used by the program's users, and also do things like use a third-party tool DW2XLS (see sidebar) to export almost perfectly formatted versions of reports to Excel.

Speaking of PDF, neither PDF option provided by PB seemed sufficient for DONATION's needs - one required end users to separately download GhostScript, something unrealistic for my users (many of whom are not computer experts), and the other just doesn't work for some report types. As a result, I ended up including a commercial PDF printer driver with API capabilities into the application (novaPDF SDK - see sidebar), which mostly works very well.

Mail Merge
The application required mail merge capabilities for users to send correspondence, including thank you letters to donors about their donations, and to allow users to format their own charitable receipts if they didn't like the built-in receipts in the program (which were normal PB reports).

For years this was done in DONATION by controlling Microsoft Word or WordPerfect via OLE. This was awkward and didn't provide a good user experience because it involved going in and out of the program, and using another UI that they might not be familiar with. (They would probably be familiar with their word processor, but not necessarily with its mail merge features.)

In addition, because I was using the mail merge features in those word processors, there was no way to do anything like sub-reports, which were optimally required for the charitable receipts. (Many users, especially in churches, want a main section describing the total donation amount, for the government, and a second section, for them to keep, listing the details - date, amount and donation category - of each donation.)

To work around these issues required taking another approach, with some form of embedded word processor that could be controlled with an API, to do the merging programmatically. I looked at some commercial options, such as TX Text Control, but ended up with a much simpler solution: have the merge files be HTML files, edited using Internet Explorer's Design Mode.

Design Mode is a little-known feature of IE (at least, it was unknown to me). Activating it turns IE into a relatively simple but still relatively capable HTML editor. You embed an IE control into a PB window, add some menus and toolbars that activate functions in IE's OLE API, and you have something that works really well. Fortunately, there is a freely usable PowerBuilder example of doing this, at http://www.topwizprogramming.com/freecode_webbrowser.html.

After enhancing that to add mail merge features, including special mail merge fields that handled the required subreports, everything worked extremely smoothly (see Figure 1). For cases when the editing capabilities of Design Mode were insufficient, an option was given to edit the HTML file in MS Word. (The editor window's activate event is used to check for the file being saved externally and prompt to reload it.)

Conclusion
PowerBuilder provides a powerful environment for creating end-user applications whose primary purpose is data entry and reporting, such as DONATION. It allows me to be very fast and responsive about fixing bugs and creating new features needed by the program's many users, and to design an application usable even by users who consider themselves to be fairly computer-illiterate.

More Stories By Dan Cooperstock

Dan Cooperstock is the owner and sole staff person of Cooperstock Software, which creates and sells the DONATION program from www.Software4Nonprofits.com. He has been a professional programmer for nearly 30 years, working for a range of employers, including both small and large software companies, and financial institutions. Although his income as a one-man software business is lower than it was as an employed programmer, and he doesn’t get to do as much programming (you can’t keep forcing features on users!), he finds the job satisfaction greatly outweighs those other factors. He has used PowerBuilder since version 5.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Latest Stories
Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, discussed how given the magnitude of today's application ...
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the bene...
You know you need the cloud, but you're hesitant to simply dump everything at Amazon since you know that not all workloads are suitable for cloud. You know that you want the kind of ease of use and scalability that you get with public cloud, but your applications are architected in a way that makes the public cloud a non-starter. You're looking at private cloud solutions based on hyperconverged infrastructure, but you're concerned with the limits inherent in those technologies. What do you do?
Recently, WebRTC has a lot of eyes from market. The use cases of WebRTC are expanding - video chat, online education, online health care etc. Not only for human-to-human communication, but also IoT use cases such as machine to human use cases can be seen recently. One of the typical use-case is remote camera monitoring. With WebRTC, people can have interoperability and flexibility for deploying monitoring service. However, the benefit of WebRTC for IoT is not only its convenience and interopera...
Sanjeev Sharma Joins June 5-7, 2018 @DevOpsSummit at @Cloud Expo New York Faculty. Sanjeev Sharma is an internationally known DevOps and Cloud Transformation thought leader, technology executive, and author. Sanjeev's industry experience includes tenures as CTO, Technical Sales leader, and Cloud Architect leader. As an IBM Distinguished Engineer, Sanjeev is recognized at the highest levels of IBM's core of technical leaders.
In his general session at 21st Cloud Expo, Greg Dumas, Calligo’s Vice President and G.M. of US operations, discussed the new Global Data Protection Regulation and how Calligo can help business stay compliant in digitally globalized world. Greg Dumas is Calligo's Vice President and G.M. of US operations. Calligo is an established service provider that provides an innovative platform for trusted cloud solutions. Calligo’s customers are typically most concerned about GDPR compliance, application p...
Mobile device usage has increased exponentially during the past several years, as consumers rely on handhelds for everything from news and weather to banking and purchases. What can we expect in the next few years? The way in which we interact with our devices will fundamentally change, as businesses leverage Artificial Intelligence. We already see this taking shape as businesses leverage AI for cost savings and customer responsiveness. This trend will continue, as AI is used for more sophistica...
The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
Product connectivity goes hand and hand these days with increased use of personal data. New IoT devices are becoming more personalized than ever before. In his session at 22nd Cloud Expo | DXWorld Expo, Nicolas Fierro, CEO of MIMIR Blockchain Solutions, will discuss how in order to protect your data and privacy, IoT applications need to embrace Blockchain technology for a new level of product security never before seen - or needed.
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
The past few years have brought a sea change in the way applications are architected, developed, and consumed—increasing both the complexity of testing and the business impact of software failures. How can software testing professionals keep pace with modern application delivery, given the trends that impact both architectures (cloud, microservices, and APIs) and processes (DevOps, agile, and continuous delivery)? This is where continuous testing comes in. D