Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
UIM for Print Files?
has no ratings.
Published: 26 Feb 2014
Revised: 26 Feb 2014 - 1121 days ago
Last viewed on: 23 Mar 2017 (1953 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

UIM for Print Files? Published by: Bob Cozzi on 26 Feb 2014 view comments(2)

I'm trying to build a generic Report tool (like RUNQRY but with support for SQL Select). I have never used UIM except for Command Helptext, and I'm wondering if anyone has done any work in that area and can share some tips.

For example, is there a core setup of API calls that produce reports based on data passed to the UIM APIs?

I am trying to avoid creating a PRINT FILE for each and every report the client is going to produce.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: UIM for Print Files?
Posted: 3 years 26 days 3 hours 46 minutes ago

I've done command and application help, and also UIM menus. There was a UIM application in QUSRTOOL years ago, which I looked at once, but I don't even know if that's still there. It had a display application, and a menu, but I don't recall if it had any printing.

That being said, it looks like there are two possibilities for printing.

  1. Attach to an already open display application, using Add Print Application (QUIADDPA), and Remove Print Application (QUIRMVPA). In between those, use Print Panel (QUIPRTP) to print a specified panel. All the variables (data) come from the open display application, including lists. So, basically, a fancy print screen. Also, since this attaches to an open display application, you can't do this in batch.
  2. Open a print application, using Open Print Application (QUIOPNPA), with an eventual Close Application (QUICLOA). In between you would use the same Print Panel (QUIPRTP) API to generate your report. If you wanted to try UIM, this is they way you would have to go.

The downfall is that the panel group must exist before you open the application. The APIs allow you to set (and get) dialog variables, and add, update, and remove list entries (think subfiles), but there aren't any APIs to dynamically modify the panel group elements. The panel group must exist when you open the application. I guess you could dynamically generate panel group source and compile it before opening the application (good luck with that).

Here's a thought: would QueryManager be an option? QM queries and forms are both created from a source member. There's other stuff in there, but the primary content of QM query source is a SELECT statement, so that shouldn't too much different from dynamic embedded SQL. But I've never dealt with QM forms. Don't know what their source looks like (always just let it do the default formatting, since I never used QM in production). The obvious limitation here is that your generic report needs to be able to be expressed as a single SELECT statement.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: UIM for Print Files?
Posted: 3 years 26 days 2 hours 52 minutes ago

Dale, thanks. That does clearify things regarding UIM for me.

It means I will probably create a program-described file, add one big-ass output field to it. Override the print file and build the print lines in code.