MERGe is the report generator for MaxBase. It is quite capable, being able to print on paper, draw on screen, create HTML tables, generate NetRexx and Java code to reproduce reports in your code. You can use it as an user and as a developer tool -- right now MERGe produces line-mode reports.

NOTE: MERGe will act differently if you load it as a standalone program (MERGe can be started by typing 'java nrio.reports.MBReport' at a command prompt) as opposed to calling it from MaxBase (MERGe can be launched from the TOOLS panel). If you load it from MaxBase while a database is loaded, MERGe will be set up using current MaxBase database (and query) information and it will not allow you to change DB, while if you load MERGe by clicking on its own icon you will be able to load any DB you like.

See MERGe in action:

 
  MERGe is built to act like a "wizard", a notebook that will produce output after you've customized its parts.

The first page (labeled OPTIONS in the tab) is divided in two parts: the upper is used to load and save reports (MaxBase line mode reports are files which end with the .lmr extension, page layout information is saved with the .rps extension), the lower is used to choose paper size. Please note that you need a JVM at a 1.1.5 level in order to see correct paper size, since there was a bug in the 1.1.x series prior to 1.1.5.

NOTE: when you load a report and you have launched MERGe from MaxBase, database information will continue to be taken from MaxBase. In that case you will only be loading color information and, if the number of fields is the same, field names.

In the second page (labeled DATABASE) you will find information about the database. If you are using MERGe standalone you'll be able to load a database from which to get the records and fields information, otherwise you will only be able to issue a new query (a query is the same thing as a MaxBase filter).

You can order the database and issue a query using the buttons and textfields in this page: in order to select only some records, enter a query in the editable text field and press the "query" button. The syntax for queries is the same of that for filters in MaxBase.

If you want to customize the page setup, switch to the fourth page of MERGe before actually printing the report. A new tabbed interface will let you customize margins, header, footer and so on. Let's see how.

In the first page you can set the margins, by filling the text fields.

In the second sub-page, you'll find the options for including an image in your reports. You can tell MERGe to use the image as it is (centered), scale it to fit the whole page (maximized, retaining the original aspect ratio), or tile it (tiled).

A neat feature is that MERGe will try to load the image as you type the path (if you don't choose to browse directories using the "browse" button).

In the last sub-page there are all of the remaining options for page setup:

Beside the usual widgets that let you customize fonts, alignment and colors, you will find in this page two text fields that let you enter the text of the page header and footer. Three macros are available (as you can see from the picture):

  • $D will be expanded into the current date and time.
  • $P will be expanded into the currently being printed page.
  • $T will be expanded into the total number of pages.

Once you've chosen your printer, database and so on, you can switch to the third page, where you can visually compose your report. The main component of this page is a yellow list that holds eight names. When you click on one of them, you can use the color and font customization widgets to make it appear as you want. Beware that you have a lot of freedom in doing so. For example, by making horizontal record lines invisible or vertical record lines invisible, you'll get two very different looking reports.

From this page you can also control the visual appearance of fields, with the field arrangement dialog or by using the controls in the lower end of the window. Change alignment, maximum length, order and hide or show whatever field you want.

As a visual cue to help you understanding how big will your report be, you will have two widgets in the very bottom of the page that show maximum record width and number of pages.

Maximum record width is a measure of how large your report could be, if your records used up all of the estate available to them (most fonts are proportional, so actual width may vary depending on which characters are present in a record). If this value is painted in red, it means that you may exceed paper width, if it is in blue it means that you're ok, no matter what.

Number of pages obviously tells you how many pages long will your report be.

When you are done editing things, you have three choices: source code, preview and print. Source code brings up a dialog that lets you select a language in which to translate the report, and optionally save the report/select it for you to place it in the clipboard.

To make it work, you should select a language and then press "refresh". Then you can edit the output and copy it into the clipboard or save it in a file.

Please note that HTML output is very different from Java and NetRexx output. HTML source produces an HTML table (complete with color and field information) to be used in your web pages, while the other two create Java or NetRexx code that you can reuse in your programs to reproduce a report exactly as it is.

Preview does actually what it says: it prints your report on screen, so you can peruse it before printing it. On the top of the page you can find a list from which to select a page to be displayed.

Note: The size of the window is set to be the same as the size of the paper that will hold the print.

Finally, you can print your report. This button brings up a dialog that lets you select which pages to print, and in which order. Basically you must select the page(s) you want printed, and then push on "print". Some buttons are available to automatically select odd/even/all pages, or to clear the current selection; you can also print in reversed order.

NOTE: Why to print odd or even pages? If you have a printer that can't print on both sides of the paper, this option will help you speeding up the printing process: if you print all of the odd pages, then take the printed pages out of your printer, flip them frontside back, put them back in the paper feed tray, then choose to print the even pages, you will have printed everything in the correct order.


Max Marsiglietti © 1997
Layout and artwork Andrea Resmini 1997