1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
7 &IF DEFINED(UIB_IS_RUNNING) &THEN
8 DEF VAR report-options
AS CHAR NO-UNDO INITIAL "".
10 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
13 DEF VAR active-flag
AS LOGI
NO-UNDO INIT Yes.
14 DEF VAR by-projectcode
AS LOGI
NO-UNDO.
15 DEF VAR by-entitycode
AS LOGI
NO-UNDO.
16 DEF VAR by-shortname
AS LOGI
NO-UNDO.
18 DEF VAR sort-desc
AS CHAR NO-UNDO.
19 DEF VAR filt-desc
AS CHAR NO-UNDO.
21 DEF VAR preview
AS LOGI
NO-UNDO INIT Yes.
22 DEF VAR user-name
AS CHAR NO-UNDO.
23 {inc
/username.i
"user-name"}
24 DEF VAR timeStamp
AS CHAR FORMAT "X(44)" NO-UNDO.
25 timeStamp
= STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
27 /* _UIB-CODE-BLOCK-END
*/
31 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
33 /* ******************** Preprocessor Definitions
******************** */
35 &Scoped-define PROCEDURE-TYPE Procedure
36 &Scoped-define DB-AWARE no
40 /* _UIB-PREPROCESSOR-BLOCK-END
*/
45 /* *********************** Procedure Settings
************************ */
47 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
48 /* Settings for
THIS-PROCEDURE
52 Add Fields to
: Neither
53 Other Settings
: CODE-ONLY
COMPILE
55 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
57 /* ************************* Create Window
************************** */
59 &ANALYZE-SUSPEND _CREATE-WINDOW
60 /* DESIGN Window definition
(used by the UIB
)
61 CREATE WINDOW Procedure
ASSIGN
64 /* END WINDOW DEFINITION
*/
68 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
69 /* ************************* Included-Libraries
*********************** */
71 {inc
/method
/m-txtrep.i
}
73 /* _UIB-CODE-BLOCK-END
*/
80 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
83 /* *************************** Main Block
*************************** */
87 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
89 RUN pclrep-start
( preview
, "reset,portrait,tm,2,a4,lm,4,courier,cpi,18,lpi,9").
97 /* _UIB-CODE-BLOCK-END
*/
101 /* ********************** Internal Procedures
*********************** */
103 &IF DEFINED(EXCLUDE-each-project) = 0 &THEN
105 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-project Procedure
106 PROCEDURE each-project
:
107 /*------------------------------------------------------------------------------
111 ------------------------------------------------------------------------------*/
113 RUN pclrep-line
( "courier,Fixed,cpi,18,lpi,9,Normal",
114 STRING( Project.ProjectCode
, "99999" ) + SPC
(4) +
115 STRING( Project.Active
, "Yes/No" ) + SPC
( 4 ) +
116 STRING( Project.Name
, "X(30)" ) + SPC
( 4 ) +
118 STRING( Project.EntityCode
, "99999" )
123 /* _UIB-CODE-BLOCK-END
*/
128 &IF DEFINED(EXCLUDE-group-header) = 0 &THEN
130 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE group-header Procedure
131 PROCEDURE group-header
:
132 /*------------------------------------------------------------------------------
136 ------------------------------------------------------------------------------*/
138 DEF INPUT PARAMETER header-text
AS CHAR NO-UNDO.
140 RUN pclrep-line
( "Helvetica,Point,8,Bold,Proportional", header-text
).
141 RUN pclrep-line
( "", "" ).
145 /* _UIB-CODE-BLOCK-END
*/
150 &IF DEFINED(EXCLUDE-inst-page-footer) = 0 &THEN
152 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
153 PROCEDURE inst-page-footer
:
154 /*------------------------------------------------------------------------------
155 Purpose
: Print any page footer
156 ------------------------------------------------------------------------------*/
160 /* _UIB-CODE-BLOCK-END
*/
165 &IF DEFINED(EXCLUDE-inst-page-header) = 0 &THEN
167 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-header Procedure
168 PROCEDURE inst-page-header
:
169 /*------------------------------------------------------------------------------
170 Purpose
: Print any page header
171 ------------------------------------------------------------------------------*/
173 RUN pclrep-line
( "univers,Point,7,bold,proportional", TimeStamp
).
174 RUN pclrep-line
( "univers,Point,12,bold,proportional",
175 FILL( " ", 45) + "Project Listing by " + sort-desc
178 RUN pclrep-line
( "", "").
179 RUN pclrep-line
( "courier,Fixed,cpi,18,lpi,9,Bold",
180 STRING( "Code", "X(5)" ) + SPC
(4) +
181 STRING( "Active", "X(5)" ) + SPC
( 2 ) +
182 STRING( "Name", "X(30)" ) + SPC
( 4 ) +
183 STRING( "Owning Entity", "X(13)" )
185 RUN pclrep-line
( "", "").
189 /* _UIB-CODE-BLOCK-END
*/
194 &IF DEFINED(EXCLUDE-parse-parameters) = 0 &THEN
196 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
197 PROCEDURE parse-parameters
:
198 /*------------------------------------------------------------------------------
202 ------------------------------------------------------------------------------*/
204 DEF VAR i
AS INT NO-UNDO.
205 DEF VAR token
AS CHAR NO-UNDO.
207 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
208 token
= ENTRY( i
, report-options
, "~n" ).
210 CASE ENTRY( 1, token
):
214 CASE ENTRY( 2,token
):
215 WHEN "Code" THEN ASSIGN by-projectcode
= Yes sort-desc
= "Project Code".
216 WHEN "Entity" THEN ASSIGN by-entitycode
= Yes sort-desc
= "Owning Entity".
221 CASE ENTRY( 2, token
):
222 WHEN "Yes" THEN ASSIGN active-flag
= Yes filt-desc
= "Active Only".
223 WHEN "No" THEN ASSIGN active-flag
= No filt-desc
= "Inactive Only".
224 OTHERWISE ASSIGN active-flag
= ? filt-desc
= "".
227 WHEN "Preview" THEN preview
= ENTRY( 2, token
) = "Yes".
235 /* _UIB-CODE-BLOCK-END
*/
240 &IF DEFINED(EXCLUDE-project-listing) = 0 &THEN
242 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE project-listing Procedure
243 PROCEDURE project-listing
:
244 /*------------------------------------------------------------------------------
248 ------------------------------------------------------------------------------*/
250 &SCOP WHERE-PHRASE WHERE ( IF active-flag = ? THEN True ELSE Project.Active = active-flag )
252 IF by-projectcode
THEN
253 FOR EACH Project
NO-LOCK {&WHERE-PHRASE}:
257 ELSE IF by-entitycode
THEN
258 FOR EACH Project
NO-LOCK {&WHERE-PHRASE}
259 BREAK BY Project.EntityType
BY Project.EntityCode
:
261 IF FIRST-OF( Project.EntityCode
) THEN
263 RUN group-header
( Project.EntityType
+ STRING(Project.EntityCode
,"99999") ).
268 IF LAST-OF( Project.EntityCode
) THEN RUN pclrep-line
( ?
, ?
).
275 /* _UIB-CODE-BLOCK-END
*/