Consultor Eletrônico



Kbase 21397: How To Deploy Report Builder in Single User Using _PRORE?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   18/09/2008
Status: Verified

GOAL:

How to deploy Report Builder in a Single User environment (Shared Memory) using _prore (PRORE.EXE)?

GOAL:

How To Deploy Report Builder in Single User Using _PRORE?

FACT(s) (Environment):

Progress 8.x
Progress 9.x

CAUSE:

It is possible in Single User (Shared Memory) to print reports within Report Builder.
The -RO option is not required. It is recommended because access to the Database in read only mode will not return all the newly created records inside your Database. Read only can only access data stored on your Hard Drive, not the newly created records still in memory and not yet transferred to disk.

Basically you will have to run with 2 Databases:

-- Copy of Sports2000 Database, and
-- ReportDB which will be used for Report Builder be able to instantiate the reports.

The reason for creating separated Databases is because the instantiation of each printout will create in ReportDB a record each time you want to print a record. This record is automatically deleted from the ReportDB and would cause fragmentation if the RBReportTable was placed in the sports2000 Database.
To avoid this we must have two separate DataBases.

FIX:

Steps to follow:

1) Create a working directory. (make sure to mention it in PROPATH).

2) Create a Sports2000 Database called Sports2000.

3) Create an empty Database called ReportDB.

4) Start a Progress session and connect to ReportDB.

5) Go to Data Administration, Load Data Definition.

6) Select the df file to load, placed in DLC\BIN\RBreport.df.

7) Once the df is loaded, disconnect from ReportDB.

8) Start a Broker in Shared Memory (Single-User) as follows:

proserve sports2000 -N tcp -H LocalHost -S 9999.
9) Connect to Report Builder in Multi-user mode (Shared Memory with the parameters -N -H -S as the broker).

10) Build your report and save it in a library called CUSTOMER.PRL and name the report CUSTOMER.

11) Now we move on to creating 2 small programs you'll need to have. These 2 procedures allow you to be able to call Report Builder within your application.

First Procedure

/------------------------------------------------------*/
/* RB-PRORE.P */
/------------------------------------------------------*/

DEFINE VARIABLE RB-LIBRARY-NAME AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-REPORT-NAME AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-DB-CONNECTION AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-INCLUDE-RECORDS AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-FILTER AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-MEMO-FILES AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINT-DESTINATION AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINTER-NAME AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINTER-PORT AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-OUTPUT-FILE AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-NUMBER-COPIES AS INTEGER NO-UNDO.
DEFINE VARIABLE RB-BEGIN-PAGE AS INTEGER NO-UNDO.
DEFINE VARIABLE RB-END-PAGE AS INTEGER NO-UNDO.
DEFINE VARIABLE RB-TEST-PATTERN AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-WINDOW-TITLE AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-DISPLAY-ERRORS AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-DISPLAY-STATUS AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-NO-WAIT AS LOGICAL NO-UNDO.
DEFINE VARIABLE RB-OTHER-PARAMETERS AS CHARACTER NO-UNDO.

ASSIGN RB-LIBRARY-NAME = "d:\progress\wrk91c\reportbuilder\CUSTOMER.prl"
RB-REPORT-NAME = "CUSTOMER"
RB-DB-CONNECTION = "sports2000=sports2000 -H LocalHost -N tcp -S 9999"
RB-INCLUDE-RECORDS = ""
RB-FILTER = ""
RB-MEMO-FILES = ""
RB-PRINT-DESTINATION = "D"
RB-PRINTER-NAME = ""
RB-PRINTER-PORT = ""
RB-OUTPUT-FILE = ""
RB-NUMBER-COPIES = 1
RB-BEGIN-PAGE = 1
RB-END-PAGE = 99
RB-TEST-PATTERN = NO
RB-WINDOW-TITLE = ""
RB-DISPLAY-ERRORS = YES
RB-DISPLAY-STATUS = YES
RB-NO-WAIT = NO
RB-OTHER-PARAMETERS = "".

IF NOT CONNECTED("RBREPORT") THEN
CONNECT d:\progress\wrk91c\reportbuilder\REPORTDB -1 .

RUN rb-table.p (INPUT RB-LIBRARY-NAME,
INPUT RB-REPORT-NAME,
INPUT RB-DB-CONNECTION,
INPUT RB-INCLUDE-RECORDS,
INPUT RB-FILTER,
INPUT RB-MEMO-FILES,
INPUT RB-PRINT-DESTINAT.ION,
INPUT RB-PRINTER-NAME,
INPUT RB-PRINTER-PORT,
INPUT RB-OUTPUT-FILE,
INPUT RB-NUMBER-COPIES,
INPUT RB-BEGIN-PAGE,
INPUT RB-END-PAGE,
INPUT RB-TEST-PATTERN,
INPUT RB-WINDOW-TITLE,
INPUT RB-DISPLAY-ERRORS,
INPUT RB-DISPLAY-STATUS,
INPUT RB-NO-WAIT,
INPUT RB-OTHER-PARAMETERS).

DISCONNECT REPORTDB.

RUN aderb/_prore(FALSE, "d:\progress\wrk91c\ReportBuilder\reportDB -1 -rbdel").

Second Procedure

/------------------------------------------------------*/
/* RB-TABLE.P */
/------------------------------------------------------*/

DEFINE INPUT PARAMETER RB-LIBRARY-NAME AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-REPORT-NAME AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-DB-CONNECTION AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-INCLUDE-RECORDS AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-FILTER AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-MEMO-FILES AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-PRINT-DESTINATION AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-PRINTER-NAME AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-PRINTER-PORT AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-OUTPUT-FILE AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-NUMBER-COPIES AS INTEGER NO-UNDO.
DEFINE INPUT PARAMETER RB-BEGIN-PAGE AS INTEGER NO-UNDO.
DEFINE INPUT PARAMETER RB-END-PAGE AS INTEGER NO-UNDO.
DEFINE INPUT PARAMETER RB-TEST-PATTERN AS LOGICAL NO-UNDO.
DEFINE INPUT PARAMETER RB-WINDOW-TITLE AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER RB-DISPLAY-ERRORS AS LOGICAL NO-UNDO.
DEFINE INPUT PARAMETER RB-DISPLAY-STATUS AS LOGICAL NO-UNDO.
DEFINE INPUT PARAMETER RB-NO-WAIT AS LOGICAL NO-UNDO.
DEFINE INPUT PARAMETER RB-OTHER-PARAMETERS AS CHARACTER NO-UNDO.

/* Deleting previous instantiated Report */

FOR EACH RBREPORT:
DELETE RBREPORT.
END.

/* Starting transaction to create a RBREPORT Record */
DO TRANSACTION:
CREATE RBREPORT.
ASSIGN RBREPORT.RB-PRINT-DESTINATION = RB-PRINT-DESTINATION
RBREPORT.RB-PRINTER-NAME = RB-PRINTER-NAME
RBREPORT.RB-PRINTER-PORT = RB-PRINTER-PORT
RBREPORT.RB-NUMBER-COPIES = RB-NUMBER-COPIES
RBREPORT.RB-BEGIN-PAGE = RB-BEGIN-PAGE
RBREPORT.RB-END-PAGE = RB-END-PAGE
RBREPORT.RB-REPORT-LIBRARY = RB-LIBRARY-NAME
RBREPORT.RB-REPORT-NAME = RB-REPORT-NAME
RBREPORT.RB-DB-CONNECTION = RB-DB-CONNECTION
RBREPORT.RB-INCLUDE-RECORDS = RB-INCLUDE-RECORDS
RBREPORT.RB-FILTER = RB-FILTER
RBREPORT.RB-DISPLAY-STATUS = RB-DISPLAY-STATUS
RBREPORT.RB-DISPLAY-ERRORS = RB-DISPLAY-ERRORS
RBREPORT.RB-OTHER-PARAMETERS = RB-OTHER-PARAMETERS.
RELEASE RBREPORT.
END.
When running these procedures you should be connected to Sports2000 and ReportDB should be disconnected. RB-prore.p procedure is run first, and will connect to ReportDB and disconnect once the report has been launched.

With this, you are able to print your report in Shared Memory (Single User), using _prore.p.
.

FIX:

References to Written Documentation:

Report Builder Deployment Guide