I have this .w procedure that runs a report I made in report builder. (see below)
It prompts the user for a date range.
The problem I have is that when I run this procedure, it takes over 1 minute to run.
If I opened up the report in report builder, using the same parameters it takes only 2 seconds.
Why does it take so long?
I've noticed that when take out the "IN- RANGE" filter, it takes only 15 seconds. Much faster but still not as fast as if I ran it from report builder.
Any ideas would be greatly appreciated!
Thanks,
Jasper
--------------------------------------------------------------------------------------------------------------
DEF VAR starting-date as date.
DEF VAR ending-date as date.
DEF VAR company as CHARACTER.
DEF VAR openrelease as CHARACTER.
DEF VAR rb-filter-value as CHARACTER initial "".
Form "Starting Date: " starting-date at 20 skip
"Enter Ending Date: " ending-date at 20 skip
with frame test-frame centered no-labels.
Update starting-date ending-date.
Hide frame test-frame.
company = "LOC".
openrelease = "Yes".
rb-filter-value = "ORDERREL.COMPANY = " + "'" + "LOC" + "'" +
" And ORDERREL.OPENRELEASE = " + openrelease +
" And IN-RANGE (ORDERREL.REQDATE, " + string(starting-date) + "," + string(ending-date) + ")".
run aderb\_printrb(
"V:\Vantage\ud\Jasper.prl", /* RB-REPORT-LIBRARY */
"Sales Backlog w/shipper", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"O", /* RB-INCLUDE-RECORDS */
rb-filter-value, /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
0, /* RB-NUMBER-COPIES - zero */
0, /* RB-BEGIN-PAGE - zero */
0, /* RB-END-PAGE - zero */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
""). /* RB-OTHER-PARAMETERS */
apply "CLOSE":U
-------------------------------------------------------------------------------------------------------------
[Non-text portions of this message have been removed]
It prompts the user for a date range.
The problem I have is that when I run this procedure, it takes over 1 minute to run.
If I opened up the report in report builder, using the same parameters it takes only 2 seconds.
Why does it take so long?
I've noticed that when take out the "IN- RANGE" filter, it takes only 15 seconds. Much faster but still not as fast as if I ran it from report builder.
Any ideas would be greatly appreciated!
Thanks,
Jasper
--------------------------------------------------------------------------------------------------------------
DEF VAR starting-date as date.
DEF VAR ending-date as date.
DEF VAR company as CHARACTER.
DEF VAR openrelease as CHARACTER.
DEF VAR rb-filter-value as CHARACTER initial "".
Form "Starting Date: " starting-date at 20 skip
"Enter Ending Date: " ending-date at 20 skip
with frame test-frame centered no-labels.
Update starting-date ending-date.
Hide frame test-frame.
company = "LOC".
openrelease = "Yes".
rb-filter-value = "ORDERREL.COMPANY = " + "'" + "LOC" + "'" +
" And ORDERREL.OPENRELEASE = " + openrelease +
" And IN-RANGE (ORDERREL.REQDATE, " + string(starting-date) + "," + string(ending-date) + ")".
run aderb\_printrb(
"V:\Vantage\ud\Jasper.prl", /* RB-REPORT-LIBRARY */
"Sales Backlog w/shipper", /* RB-REPORT-NAME */
"", /* RB-DB-CONNECTION */
"O", /* RB-INCLUDE-RECORDS */
rb-filter-value, /* RB-FILTER */
"", /* RB-MEMO-FILE */
"D", /* RB-PRINT-DESTINATION */
"", /* RB-PRINTER-NAME */
"", /* RB-PRINTER-PORT */
"", /* RB-OUTPUT-FILE */
0, /* RB-NUMBER-COPIES - zero */
0, /* RB-BEGIN-PAGE - zero */
0, /* RB-END-PAGE - zero */
no, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
yes, /* RB-DISPLAY-ERRORS */
yes, /* RB-DISPLAY-STATUS */
no, /* RB-NO-WAIT */
""). /* RB-OTHER-PARAMETERS */
apply "CLOSE":U
-------------------------------------------------------------------------------------------------------------
[Non-text portions of this message have been removed]