Launching Report Builder Takes Forever

ChezJfrey

New Member
I have a report that takes about 5-10 seconds to preview in the Report Builder development interface. However, using the code below to launch the same report within a procedure, with the same selection criteria passed as parameters, the report takes about 15 minutes to display. Does anyone know why this might be? I have tried using both _prore and _printrb with no success; they both take way too long to display the report. Am I missing something in the code? Why would the performance be so poor? I have double checked the parameters to make sure they match what I used in the development interface and they are exactly the same and I am connected to the same database. Any help or insight is greatly appreciated.

DEFINE VARIABLE SystemID AS CHARACTER NO-UNDO.
DEFINE VARIABLE BeginDate AS CHARACTER NO-UNDO.
DEFINE VARIABLE EndDate AS CHARACTER NO-UNDO.
DEFINE VARIABLE WCBegin AS CHARACTER NO-UNDO.
DEFINE VARIABLE WCEnd AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-LIBRARY 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-FILE AS CHARACTER NO-UNDO.
DEFINE VARIABLE RB-PRINT-DESTINATION AS CHARACTER INITIAL 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.
DEFINE VARIABLE rb-int-tag AS INTEGER NO-UNDO.
DEFINE VARIABLE v-DLC AS CHARACTER NO-UNDO.
DEFINE VARIABLE v-parameters AS CHARACTER NO-UNDO.
DEFINE VARIABLE v-rb-tag AS CHARACTER NO-UNDO.

ASSIGN
RB-DISPLAY-ERRORS = Yes
RB-NO-WAIT = No
SystemID = "001"
BeginDate = "08/02/2001"
EndDate = "08/08/2001"
WCBegin = "3000"
WCEnd = "5999"
RB-DB-CONNECTION = "-db gams1 -S SomeService -N -H SomeServerName -U " + USERID("gams1":U) +
" -P somepassword"
RB-LIBRARY = "H:\MWPG\Source\6.20\custom\CD-MWOpMetrics.prl"
RB-REPORT-NAME = "MWOpMetrics"
RB-OTHER-PARAMETERS = "SystemID = " + SystemID + "~n" +
"BeginDate = " + BeginDate + "~n" +
"EndDate = " + EndDate + "~n" +
"WCBegin = " + WCBegin + "~n" +
"WCEnd = " + WCEnd
.

/* &SCOPED-DEFINE USE_prore */

&IF DEFINED(USE_prore) &THEN
{hsi/sequence.i}

RUN p-get-next-sequence-number(INPUT "rbreport",
INPUT SystemID,
OUTPUT rb-int-tag).
DO TRANSACTION:
CREATE RBReport.
ASSIGN
v-rb-tag = SystemID + STRING(rb-int-tag)
RBReport.RB-Report-Library = RB-LIBRARY
RBReport.RB-Report-Name = RB-REPORT-NAME
RBReport.RB-Db-Connection = "gams1=>gams1"
RBReport.RB-Include-Records = RB-INCLUDE-RECORDS
RBReport.RB-Filter = RB-FILTER
RBReport.RB-Memo-File = RB-MEMO-FILE
RBReport.RB-Print-Destination = RB-PRINT-DESTINATION
RBReport.RB-Printer-Name = RB-PRINTER-NAME
RBReport.RB-Printer-Port = RB-PRINTER-PORT
RBReport.RB-Output-File = RB-OUTPUT-FILE
RBReport.RB-Number-Copies = RB-NUMBER-COPIES
RBReport.RB-Begin-Page = RB-BEGIN-PAGE
RBReport.RB-End-Page = RB-END-PAGE
RBReport.RB-Test-Pattern = RB-TEST-PATTERN
RBReport.RB-Window-Title = RB-WINDOW-TITLE
RBReport.RB-Display-Errors = RB-DISPLAY-ERRORS
RBReport.RB-Display-Status = RB-DISPLAY-STATUS
RBReport.RB-Other-Parameters = RB-OTHER-PARAMETERS
RBReport.RB-Tag = v-rb-tag
.

RELEASE RBReport.
END. /* TRANSACTION */

ASSIGN v-parameters = RB-DB-CONNECTION + " -rbtabledb gams1 -rbtag " + v-rb-tag.

RUN aderb\_prore(false, v-parameters).

DO TRANSACTION:
FIND FIRST RBReport
WHERE RBReport.RB-Tag = v-rb-tag
EXCLUSIVE-LOCK NO-ERROR.
IF AVAILABLE (RBReport) THEN
DELETE RBReport.
END. /* TRANSACTION */
&ELSE
GET-KEY-VALUE SECTION "Startup" KEY "DLC" VALUE v-DLC.
RUN VALUE(v-DLC + "\gui\aderb/_printrb.p")
(RB-LIBRARY,
RB-REPORT-NAME,
RB-DB-CONNECTION,
RB-INCLUDE-RECORDS,
RB-FILTER,
RB-MEMO-FILE,
RB-PRINT-DESTINATION,
RB-PRINTER-NAME,
RB-PRINTER-PORT,
RB-OUTPUT-FILE,
RB-NUMBER-COPIES,
RB-BEGIN-PAGE,
RB-END-PAGE,
RB-TEST-PATTERN,
RB-WINDOW-TITLE,
RB-DISPLAY-ERRORS,
RB-DISPLAY-STATUS,
RB-NO-WAIT,
RB-OTHER-PARAMETERS).
&ENDIF
 
Top