Consultor Eletrônico



Kbase 18711: Report Builder: Sample Program to Display Date Filter Information in Title
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   11/11/2004
Status: Verified

GOAL:

How to use the Report Builder Engine to display Date Range criteria in the title of a Report.

FIX:

The capability of displaying date filter information in the title gives the users more flexibility designing a front-end for their Report Builder reports.

STEP BY STEP DETAILS:

1) Create a Report against the Sports Database for the Order Table.

2) Create a calculated field called BegDte and in the Expression type the following; RUNTIME-PARAMETER("bdate").

3) Create a calculated field called EndDte and in the Expression type the following; RUNTIME-PARAMETER("edate").

4) Create a calculated field called BegDate and in the Expression type the following; DATE(BegDte).

5) Create a calculated field called EndDate and in the Expression type the following; DATE(EndDte).

6) Create a Filter Expression like the following; Order.Order-Date >= BegDate AND Order.Order-Date <= EndDate.

7) In the Title of the Report, Insert the BegDte and EndDte fields.

8) Close and Save the Report(I saved it in the Reports.prl under the name DateRange for the purposes of this test).

9) In the Procedure Editor, enter the following;

/*********** DateRange.p ************************************/

DEFINE VARIABLE bdate AS DATE NO-UNDO.
DEFINE VARIABLE edate AS DATE NO-UNDO.

UPDATE bdate LABEL "Start Date" edate LABEL "End Date".

RUN gui\aderb\_printrb.p
("reports.prl", /* RB-REPORT-LIBRARY */
"DateRange", /* 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 */
1, /* RB-NUMBER-COPIES */
1, /* RB-BEGIN-PAGE */
99999, /* RB-END-PAGE */
NO, /* RB-TEST-PATTERN */
"", /* RB-WINDOW-TITLE */
TRUE, /* RB-DISPLAY-ERRORS */
TRUE, /* RB-DISPLAY-STATUS */
FALSE, /* RB-NO-WAIT */
"bdate = " + STRING(bdate) + " ~n edate = "
+ STRING(edate) + ""). /* RB-OTHER-PARAMETERS */

/*********** DateRange.p ************************************/

10) When Prompted for output type, select output to Screen.