Banded Report Writer Revealed – RTI_BRW_GenerateReport
Our next installment in the Banded Report Writer Revealed series explores the second of the two primary stored procedures that provide command line interaction with this rich reporting tool. Whereas the RTI_BRWSupport function provides multiple services, the RTI_BRW_GenerateReport function only has one purpose: to generate BRW reports. Thus, RTI_BRW_GenerateReport works with the Banded Report Writer in much the same way that Run_Report works with the Report Builder. Like the RTI_BRWSupport function, RTI_BRW_GenerateReport is documented in the more recent BRW Reference Guides (see pages 82ff.), but we’ll see that there is still more to discover than what has been put in the official documentation.
One might ask this question: if the RTI_BRWSupport function can also generate BRW reports (via the DISPLAY action), why do we need RTI_BRW_GenerateReport? Why not just focus on RTI_BRWSupport as a one-stop-shop function? One of the most significant reasons is that RTI_BRWSupport does not communicate directly with the Banded Report Writer .NET assembly. Instead, it goes through the same layer that the Set_Printer LOADREPORT message does: OIPI.Net. This is relevant because OIPI.Net works through the OpenInsight presentation server.
RTI_BRW_GenerateReport, on the other hand, works directly with the underlying .NET assembly. This opens up additional opportunities for developers who wish to provide dynamic reports through web applications or any other “engine farm” system. When the presentation server is required, the developer is forced to use an alternative approach. Typically, this becomes a rather complex and relatively brittle system that launches OpenInsight on the desktop. This instance then polls for queued report requests, generates a report, and then it notifies the waiting OpenEngine for pick up. Hence, lots of moving parts are required when the report cannot be generated directly.
The following documentation uses a layout familiar to anyone who uses the Programmer’s Reference Guide. This has also been added to our wiki site alongside the other pages of Banded Report Writer documentation:
RTI_BRW_GenerateReport is a routine that allows banded reports to be generated with a variety of options.
RTI_BRW_GenerateReport(rptFile, rptName, outputName, rptType, overrideListID, rptDetails, bUseGUI, overrideCfg)
The function has the following parameters:
[table id=8 /]
Multiple reports, even from different report groups, can be ran from a single RTI_BRW_GenerateReport call through @RM delimited values for each parameter. This is similar to the way Set_Property supports @RM delimited parameters. While multiple reports can be specified to export to a file, this cannot be used to create a single file that contains all reports. Each report must have its own file name or older reports will be overwritten.
RTI_BRW_GenerateReport is the only way to create PDF reports without the use of the Presentation Server. Using RTI_BRWSupport or the LOADREPORT Set_Printer message both work through OIPI.Net, which requires the Presentation Server.
Dynamically created XML report definitions do not support Dynamic Dictionaries. These will come through as plain text.
See the notes for the rptFile parameter for important information when passing in dynamically generated XML report definition strings.