Related Topics: Apache Web Server Journal

Apache Web Server: Article


Create applications that use the full power of the DataWindow

Many PowerBuilder developers know that InfoMaker can be used as a reporting tool. Out of the box, InfoMaker seems fairly restricted as to which type of applications can be developed. However, few people realize that InfoMaker also allows end users to create forms, the equivalent of PowerBuilder windows. Add the pipeline and database painter and you can see that end users have a very powerful tool for managing their data.

We'll look at exactly what can be done with InfoMaker. First, we'll take a high-level overview of InfoMaker's capabilities - particularly as compared to PowerBuilder's. Second, we'll look at the two primary methods available to PowerBuilder developers to add functionality to applications developed with InfoMaker:

  • Custom form styles
  • Customizing the imstyle9.pbl
Last, we'll explore how we can write code in InfoMaker without requiring PowerBuilder.

The InfoMaker Environment
InfoMaker is first and foremost a report writer built around the DataWindow. It also includes the query and library painters familiar to PowerBuilder developers. If the "write" option is selected during the install, it will install the pipeline and database painters. The "write" option also installs one of the features unique to InfoMaker - the so-called form painter - that is basically a customized window painter with a built-in wizard.

Another feature unique to InfoMaker is the Query Governor (see Figure 1), which allows an administrator to put restrictions on the types and sizes of queries the InfoMaker end user can generate. For example, it allows the administrator to limit the number of rows retrieved or the number of tables that can be joined in a select statement. However, the administrator should realize that the end user could bypass the "Data Selection Options" by converting the SQL statement to syntax. In addition, administrators may choose to deploy InfoMaker so that it uses a shared IM.INI file on the network, which will allow them to restrict certain features, such as the use of built-in forms.

InfoMaker also differs from PowerBuilder in that it does not use the concept of workspaces that was introduced with PowerBuilder 8. The GUI is essentially the same as that of PowerBuilder 7. InfoMaker also supports the same set of native, OLEDB, ODBC, and JDBC database interfaces as PB Enterprise. Unlike PowerBuilder, however, the end user can only be connected to one database at a time.

Library Painter
The first difference a PowerBuilder user will notice when using InfoMaker is the limited list of items visible in the library painter. The data pipeline, report, query, and form objects are the only objects available. As mentioned before, InfoMaker does not support the workspace/target concept. Instead, InfoMaker users select the "application" they are going to work on by setting the "working library." To set the working library, the end users must right-click on the pbl and choose "Set as working library." Another option on the right-click popup menu is "Print Directory," which will generate a quick report of all the objects within the pbl (including those not visible in the library painter).

The Library Search path is also set differently in InfoMaker than in PowerBuilder. In InfoMaker the Library List is used. Unlike PowerBuilder, it has two separate tabs:

  • Style Tab: Here any pbl(s) containing custom form styles and/or global functions are added. Custom form styles are described in more detail later in the article. While the pbls can be added here, the custom form styles and global functions must be created using PowerBuilder.
  • Query Tab: Here any pbl(s) containing prebuilt query objects are added, which can later be used when building reports or forms.
Report Painter
The InfoMaker report painter has many of the same basic features as the PowerBuilder DataWindow painter. The major exception is that the InfoMaker report painter does not allow end users to provide their reports with an update capability. As a result, it also does not allow the end user to set the tab order for columns in the report. This becomes a problem when trying to modify DataWindows used in forms. In the section on "Custom Form Styles" we will see how we can work around this. Also note that InfoMaker Reports always display in Print Preview mode.

Just as with PowerBuilder, InfoMaker allows you to call global functions from within a report. However, you must use PowerBuilder to create those global functions. To use global functions in your reports, first add the pbl containing these functions to the Library List's Style Tab. Note that an InfoMaker user cannot see the global functions, therefore, it's a good idea to provide a window that allows him or her to browse these functions.

Pipeline and Database Painter
These painters are exactly the same as PowerBuilder's. Database profiles for the database painter can be shared by pointing to a shared ini file on the network.

Form Painter
Forms allow you to create basic data entry screens. There are four predefined form styles:

  • Freeform
  • Gridstyle
  • Master/detail one-to-many
  • Master/detail many-to-one
When InfoMaker builds a form, it inherits from the form styles built into the imstyle9.pbl. InfoMaker automatically invokes the Query painter to select data and builds one or two hidden DataWindows, depending on the type of form. Each form also comes prebuilt with a set of actions (i.e., public window functions) that you can assign to command buttons. Unfortunately, InfoMaker provides no scripting capability for those command buttons.

Some companies prefer to disable the use of the default forms, and instead rely on their in-house developed custom form styles. In the shared initialization profile (accessed through Tools, System Options), the administrator can add the following line under the [Window] section to disable default forms:

ShowStandardStyles = 0

Setting this parameter in the local im.ini file has no effect. When end users build forms, they can immediately run these in the development environment. InfoMaker does not require an application object like PowerBuilder does to run forms.

To create applications InfoMaker uses a hidden "default" application object and a hidden "default" project object. These are automatically generated when the user selects "Design, Create Executable" from within InfoMaker. When doing so, the user can choose to reuse the settings from the most recently created executable or start with new settings. If the first option is chosen, InfoMaker will examine the last built executable and extract from the m_pbstyle_frame menu all the objects that were included. A wizard steps the user through the whole build process, allowing them to select reports, pipelines, and forms to be included in the final executable. Desired buttons can be assigned to individual objects and reports (like those used for dropdown DataWindows) can be hidden. With InfoMaker the application is always generated as a single EXE file - there is no concept of PBD or PBR files within InfoMaker.

Together with the executable a matching initialization file is generated, i.e., myreports.ini goes with myreports.exe. The ini file always contains the [database] and [dbms_profiles] sections that have SQLCA connection parameters based on the current database profile. Optionally you can add a [pipe] and/or a [about] section (see Table 1). The [pipe] section allows a user to change the behavior of pipeline objects. The [about] section allows you to set information that will show in the "Help, About" menu of the executable.

New Features
Executable Versioning

When creating an executable you can now provide Product and File version information to executables. The version number is in the form 0,0,0,0. Besides the version number you can also provide a description. The Microsoft Installer can read the version information to determine whether to update an executable.

More Stories By Terry Dykstra

Terry Dykstra is a database administrator/developer for Canadian Forest Oil Ltd in Calgary, AB. He has used InfoMaker/PowerBuilder since version 3 and has been a TeamSybase member since 1996.

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.