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
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists looked at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deliver...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldwide re...
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.
Both SaaS vendors and SaaS buyers are going “all-in” to hyperscale IaaS platforms such as AWS, which is disrupting the SaaS value proposition. Why should the enterprise SaaS consumer pay for the SaaS service if their data is resident in adjacent AWS S3 buckets? If both SaaS sellers and buyers are using the same cloud tools, automation and pay-per-transaction model offered by IaaS platforms, then why not host the “shrink-wrapped” software in the customers’ cloud? Further, serverless computing, cl...
The taxi industry never saw Uber coming. Startups are a threat to incumbents like never before, and a major enabler for startups is that they are instantly “cloud ready.” If innovation moves at the pace of IT, then your company is in trouble. Why? Because your data center will not keep up with frenetic pace AWS, Microsoft and Google are rolling out new capabilities. In his session at 20th Cloud Expo, Don Browning, VP of Cloud Architecture at Turner, posited that disruption is inevitable for comp...
Wooed by the promise of faster innovation, lower TCO, and greater agility, businesses of every shape and size have embraced the cloud at every layer of the IT stack – from apps to file sharing to infrastructure. The typical organization currently uses more than a dozen sanctioned cloud apps and will shift more than half of all workloads to the cloud by 2018. Such cloud investments have delivered measurable benefits. But they’ve also resulted in some unintended side-effects: complexity and risk. ...
With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...
It is ironic, but perhaps not unexpected, that many organizations who want the benefits of using an Agile approach to deliver software use a waterfall approach to adopting Agile practices: they form plans, they set milestones, and they measure progress by how many teams they have engaged. Old habits die hard, but like most waterfall software projects, most waterfall-style Agile adoption efforts fail to produce the results desired. The problem is that to get the results they want, they have to ch...
IoT solutions exploit operational data generated by Internet-connected smart “things” for the purpose of gaining operational insight and producing “better outcomes” (for example, create new business models, eliminate unscheduled maintenance, etc.). The explosive proliferation of IoT solutions will result in an exponential growth in the volume of IoT data, precipitating significant Information Governance issues: who owns the IoT data, what are the rights/duties of IoT solutions adopters towards t...
"We are a monitoring company. We work with Salesforce, BBC, and quite a few other big logos. We basically provide monitoring for them, structure for their cloud services and we fit into the DevOps world" explained David Gildeh, Co-founder and CEO of Outlyer, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, Doug Vanderweide, an instructor at Linux Academy, discussed why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers wit...
While DevOps most critically and famously fosters collaboration, communication, and integration through cultural change, culture is more of an output than an input. In order to actively drive cultural evolution, organizations must make substantial organizational and process changes, and adopt new technologies, to encourage a DevOps culture. Moderated by Andi Mann, panelists discussed how to balance these three pillars of DevOps, where to focus attention (and resources), where organizations might...
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
No hype cycles or predictions of zillions of things here. IoT is big. 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, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...