SYS-CON MEDIA Authors: Liz McMillan, Elizabeth White, Pat Romanski, Gary Arora, Zakia Bouachraoui

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
Alan Hase is Vice President of Engineering and Chief Development Officer at Big Switch. Alan has more than 20 years of experience in the networking industry and leading global engineering teams which have delivered industry leading innovation in high end routing, security, fabric and wireless technologies. Alan joined Big Switch from Extreme Networks where he was responsible for product strategy for its secure campus switching, intelligent mobility and campus orchestration products. Prior to Ext...
Isomorphic Software is the global leader in high-end, web-based business applications. We develop, market, and support the SmartClient & Smart GWT HTML5/Ajax platform, combining the productivity and performance of traditional desktop software with the simplicity and reach of the open web. With staff in 10 timezones, Isomorphic provides a global network of services related to our technology, with offerings ranging from turnkey application development to SLA-backed enterprise support. Leadin...
On-premise or off, you have powerful tools available to maximize the value of your infrastructure and you demand more visibility and operational control. Fortunately, data center management tools keep a vigil on memory contestation, power, thermal consumption, server health, and utilization, allowing better control no matter your cloud's shape. In this session, learn how Intel software tools enable real-time monitoring and precise management to lower operational costs and optimize infrastructure...
Public clouds dominate IT conversations but the next phase of cloud evolutions are "multi" hybrid cloud environments. The winners in the cloud services industry will be those organizations that understand how to leverage these technologies as complete service solutions for specific customer verticals. In turn, both business and IT actors throughout the enterprise will need to increase their engagement with multi-cloud deployments today while planning a technology strategy that will constitute a ...
Cloud-Native thinking and Serverless Computing are now the norm in financial services, manufacturing, telco, healthcare, transportation, energy, media, entertainment, retail and other consumer industries, as well as the public sector. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long development cycles that pro...
Andrew Keys is co-founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereum.
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
Data center, on-premise, public-cloud, private-cloud, multi-cloud, hybrid-cloud, IoT, AI, edge, SaaS, PaaS... it's an availability, security, performance and integration nightmare even for the best of the best IT experts. Organizations realize the tremendous benefits of everything the digital transformation has to offer. Cloud adoption rates are increasing significantly, and IT budgets are morphing to follow suit. But distributing applications and infrastructure around increases risk, introdu...
Financial enterprises in New York City, London, Singapore, and other world financial capitals are embracing a new generation of smart, automated FinTech that eliminates many cumbersome, slow, and expensive intermediate processes from their businesses. Accordingly, attendees at the upcoming 23rd CloudEXPO, June 24-26, 2019 at Santa Clara Convention Center in Santa Clara, CA will find fresh new content in full new FinTech & Enterprise Blockchain track.
DevOps has long focused on reinventing the SDLC (e.g. with CI/CD, ARA, pipeline automation etc.), while reinvention of IT Ops has lagged. However, new approaches like Site Reliability Engineering, Observability, Containerization, Operations Analytics, and ML/AI are driving a resurgence of IT Ops. In this session our expert panel will focus on how these new ideas are [putting the Ops back in DevOps orbringing modern IT Ops to DevOps].
While a hybrid cloud can ease that transition, designing and deploy that hybrid cloud still offers challenges for organizations concerned about lack of available cloud skillsets within their organization. Managed service providers offer a unique opportunity to fill those gaps and get organizations of all sizes on a hybrid cloud that meets their comfort level, while delivering enhanced benefits for cost, efficiency, agility, mobility, and elasticity.
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science" is responsible for guiding the technology strategy within Hitachi Vantara for IoT and Analytics. Bill brings a balanced business-technology approach that focuses on business outcomes to drive data, analytics and technology decisions that underpin an organization's digital transformation strategy. Bill has a very impressive background which includes ...
Most organizations are awash today in data and IT systems, yet they're still struggling mightily to use these invaluable assets to meet the rising demand for new digital solutions and customer experiences that drive innovation and growth. What's lacking are potent and effective ways to rapidly combine together on-premises IT and the numerous commercial clouds that the average organization has in place today into effective new business solutions. New research shows that delivering on multicloud e...
On-premise or off, you have powerful tools available to maximize the value of your infrastructure and you demand more visibility and operational control. Fortunately, data center management tools keep a vigil on memory contestation, power, thermal consumption, server health, and utilization, allowing better control no matter your cloud's shape. In this session, learn how Intel software tools enable real-time monitoring and precise management to lower operational costs and optimize infrastructure...