Banded Report Writer Revealed – RTI_BRWSupport

Less than two weeks ago we launched a new blog series intended to provide greater depth of understanding and documentation for the Banded Report Writer. Our next two posts will focus on the primary system stored procedures (also referred to as the command line interface) that are provided to developers so the Banded Report Writer can be nicely integrated into their applications. This first article will cover the RTI_BRWSupport function. Then we will move onto RTI_BRW_GenerateReport.

RTI_BRWSupport is a handy helper routine. It is a service oriented utility, providing the developer a variety of useful actions. Two of these actions are documented in the more recent BRW Reference Guides (see pages 82ff.). Other actions have appeared in the Revelation discussion forums, thanks mostly to Bryan Shumsky. This report covers these common actions as well as many others which are likely unknown to the greater Revelation community. The following is written to mimic the standard documentation format found in the Programmer’s Reference Guide:

Description

RTI_BRWSupport is a helper routine that provides useful actions for the Banded Report Writer to perform.

Syntax

RTI_BRWSupport(Action, Param1, Param2, Param3, Param4, Param5, Param6, Param7)

Parameters

The function has the following parameters:

ParameterDescription
Action=LAUNCHStarts up the Banded Report Designer.
Param1 - Param7Not used.
ReturnsPath to the Banded Report Writer .NET assembly.
Action=READReads and returns the specified report group definition.
Param1 reportGroupName - Name of the report group.
Param2bLockFlag - Boolean flag to indicate whether the record should be locked.
Param3 - Param7Not used.
ReturnsThe XML definition of the specific report group from the SYSREPOSREPORTS table.
Special NoteThe XML definition will be returned as a CR/LF delimited string even though OpenInsight stores this as an @FM delimited string. Swapping these delimiters might be necessary in order to use the definition in other commands.
The version and dynamic dictionary attributes will not be included in the report group definition.
Action=WRITEWrites a report group definition.
Param1reportGroupName - Name of the report group.
Param2reportGroupDefinition - The XML definition of the specific group to be written to the SYSREPOSREPORTS table.
Param3defaultReport - The report within the group that will automatically run unless a specific report is indicated.
Param4 - Param7Not used.
ReturnsEmpty string.
Special NoteThis will create a new report group or it will update an existing report group as applicable. The underlying code attempts to perform a Repository("NEW"...) command first.
CR/LF delimiters will be swapped with @FM automatically so no prior corrective action is necessary (see the special notes for the READ action above.)
Action=DELETEDeletes the specified report group definition.
Param1reportGroupName - Name of the report group.
Param2 - Param7Not used.
ReturnsThe XML definition of the specific report group from the SYSREPOSREPORTS table.
Special NoteThe XML definition will be returned as a CR/LF delimited string even though OpenInsight stores this as an @FM delimited string.
Action=DISPLAYRuns and displays the specified report name from a specified report group using OIPI.NET.
Param1reportGroupName - Name of the report group.
Param2reportName - Name of the report from within the specified report group to display. (If this is omitted, then the default report for the report group will be displayed.)
Param3overrideListID - Name of the saved select list in the SYSLISTS table to use as a filter.
Param4rptDetails - Similar to the rptDetails parameter used by the RTI_BRW_GenerateReport function. This delimited array allows a specific printer and other options to be set:

<1, 1>      Printer name (as known by the Windows Print Manager)
<1, 2>      Number of copies
<1, 3>      0 or "" for Portrait, 1 for Landscape
<1, 4, 1>  Left Margin (Hundreds of an inch, i.e., 100=1")
<1, 4, 2>  Top Margin (Hundreds of an inch, i.e., 100=1")
<1, 4, 3>  Right Margin (Hundreds of an inch, i.e., 100=1")
<1, 4, 4>  Bottom Margin (Hundreds of an inch, i.e., 100=1")
<1, 5>      Page size code
<1, 6>      Print Preview caption.*
                (*Only available in OI v10, otherwise, not applicable.)
Param5 - Param7Not used.
ReturnsEmpty string.
Special NoteThis is the same as using the LOADREPORT message for the Set_Printer function except that there does not appear to be support for the Append feature.
Action=REPORTSReturns an @VM delimited list of report groups for the current application.
Param1 - Param7Not used.
ReturnsAn @VM delimited list of report groups for the current application.
Action=LISTReturns an @VM delimited list of report for the specified report group.
Param1reportGroupName - Name of the report group.
Param2 - Param7Not used.
ReturnsAn @VM delimited list of report for the specified report group.
Action=DEFAULTReturns the default report from the specified report group.
Param1reportGroupName - Name of the report group.
Param2 - Param7Not used.
ReturnsThe default report from the specified report group.
Action=KILLCloses the Banded Report Designer.
Param1 - Param7Not used.
ReturnsEmpty string.

Service Metadata

As noted above, the RTI_BRWSupport function is designed as service oriented utility. Therefore, it works well with the SRP Editor’s service module metadata feature. As a bonus, we’ve included the following metadata layout for those who want to add it to their development environment:

 <0>        SRP_EDITOR_METADATA*RTI_BRWSUPPORT

 <1>        SERVICE
 <2, 1, 1>  @QUOTED_SERVICE
 <2, 1, 2>  @PARAMS
 <3>        1
 <4>        2
 <5>        1
 <6> 
 <7, 1>     DEFAULT
 <7, 2>     DELETE
 <7, 3>     DISPLAY
 <7, 4>     KILL
 <7, 5>     LAUNCH
 <7, 6>     LIST
 <7, 7>     READ
 <7, 8>     REPORTS
 <7, 9>     WRITE
 <8, 1, 1>  reportGroupName
 <8, 2, 1>  reportGroupName
 <8, 3, 1>  reportGroupName
 <8, 3, 2>  reportName
 <8, 3, 3>  overrideListID
 <8, 3, 4>  rptDetails
 <8, 4, 1>  
 <8, 5, 1>  
 <8, 6, 1>  reportGroupName
 <8, 7, 1>  reportGroupName
 <8, 7, 2>  bLockFlag
 <8, 8, 1>  
 <8, 9, 1>  reportGroupName
 <8, 9, 2>  reportGroupDefinition
 <8, 9, 3>  defaultReport
 <9, 1, 1>  
 <9, 2, 1> 
 <9, 3, 1> 
 <9, 4, 1> 
 <9, 5, 1> 
 <9, 6, 1>  
 <9, 7, 1>  
 <9, 7, 2>  BOOLEAN
 <10>       BOOLEAN
 <11, 1, 1> False$
 <11, 1, 2> True$
 <12>       0

 

Leave a Reply