… that the new OpenInsight Banded Report Writer (BRW) in OpenInsight 9.3 has a command line interface that you can use to launch your banded reports or perform other BRW functions?
To start up the Banded Report Designer, you can do the following: CALL RTI_BRWSUPPORT("LAUNCH")
Once you have your report(s) defined, you can generate them programmatically using the following:
CALL RTI_BRW_GENERATEREPORT(rptFile, rptName, outputName, rptType, overrideListID, rptDetails, bUseGUI)
where rptFile is the name of the report group you saved the desired report(s) into and rptName is the name of the specific report to run (or “*” to run all the reports in the group). You may also specify a semicolon-delimited list of report names if desired.
OutputName is the path and name of the file to save the output to (if producing a PDF, HTM, etc. document) – leave this blank to generate printed output.
rptType is the type of output to generate, and can be PDF, TIFF, HTML, TEXT, XLS, or XLSX (or PRINT to generate printed output, but that isn’t really needed if you leave outputName blank).
overrideListID is the ID of a saved list that contains the record keys you want this report generation to use. If there is no overrideListID specified, but there is an active select list when RTI_BRW_GENERATEREPORT is called, then the active list will be used instead.
rptDetails is only used when the rptType is PDF – if desired, you can specify in rptDetails the access permissions for the PDF, and the password(s) for PDF access.
bUseGUI is a flag that indicates whether you want report generation to occur with a GUI (set bUseGUI to “1”) or without a GUI, i.e., silently (set bUseGUI to “0”). Note that if the output is going to the printer, you can also set bUseGUI to “2” – in this case, you’ll get a full print preview window, instead of just a printer control window as you would if bUseGUI is “1”. Note that the default if bUseGUI is not specified is “0” (no GUI).
You can also call, during SET_PRINTER, the LOADREPORT call; this will “embed” generated BRW output into OIPI output (this is only available when using VSPRINTER2, aka OIPI.NET). You’ll pass in to the SET_PRINTER call the name of the report group, the name of the report to include (“*” for all in the group, or a semicolon-delimited list), the overrideListName, and a flag (0/1) to indicate whether the BRW report is appended to the current output (1) or replaces the current output (0).
Note that in both cases (LOADREPORT in OIPI.NET, or RTI_BRW_GENERATEREPORT) you can if desired pass in a full report definition (which is just an XML string) in the “report group” parameter. In this way, you can actually access the report definition and modify it, or create one entirely programmatically.
If this is something you wish to do, you can use the following to read an existing report definition:
rptdef = RTI_BRWSUPPORT("READ", reportGroupName, bLockFlag)
where reportGroupName is the name of the report group, and bLockFlag is a flag to indicate whether the record should be locked (1) or left unlocked (0).
RTI_BRWSUPPORT is a handy function with a few different actions. We’ve already discussed LAUNCH and READ; you can also call it with the following actions:
DISPLAY: pass in the report group name and specific report name (in parameters 2 and 3) and the report will be displayed via OIPI.NET;
Article first published in the Revelation Software January 2011 newsletter and on http://www.revelation.com