1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 &SCOPED-DEFINE REPORT-ID "Amtrust to Budgets"
19 /* _UIB-CODE-BLOCK-END
*/
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions
******************** */
27 &Scoped-define PROCEDURE-TYPE SmartViewer
29 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
31 /* Name of first Frame and
/or Browse and
/or first Query
*/
32 &Scoped-define FRAME-NAME F-Main
35 &Scoped-define EXTERNAL-TABLES RP
36 &Scoped-define FIRST-EXTERNAL-TABLE RP
39 /* Need to scope the external tables to this procedure
*/
40 DEFINE QUERY external_tables
FOR RP.
41 /* Standard List Definitions
*/
42 &Scoped-Define ENABLED-FIELDS RP.Log1
43 &Scoped-define FIELD-PAIRS
44 &Scoped-define ENABLED-TABLES RP
45 &Scoped-define FIRST-ENABLED-TABLE RP
46 &Scoped-Define ENABLED-OBJECTS RECT-23 cmb_MonthFrom btn_print
47 &Scoped-Define DISPLAYED-FIELDS RP.Log1
48 &Scoped-Define DISPLAYED-OBJECTS cmb_MonthFrom
50 /* Custom List Definitions
*/
51 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
53 /* _UIB-PREPROCESSOR-BLOCK-END
*/
58 /* *********************** Control Definitions
********************** */
61 /* Definitions of the field level widgets
*/
62 DEFINE BUTTON btn_print
67 DEFINE VARIABLE cmb_MonthFrom
AS CHARACTER FORMAT "X(256)":U
69 VIEW-AS COMBO-BOX INNER-LINES 24
73 DEFINE RECTANGLE RECT-23
74 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
78 /* ************************ Frame Definitions
*********************** */
81 cmb_MonthFrom
AT ROW 2 COL 11 COLON-ALIGNED
82 RP.Log1
AT ROW 5.8 COL 13
87 btn_print
AT ROW 5.8 COL 49
88 RECT-23
AT ROW 1 COL 1
89 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
90 SIDE-LABELS NO-UNDERLINE THREE-D
91 AT COL 1 ROW 1 SCROLLABLE
93 DEFAULT-BUTTON btn_print.
96 /* *********************** Procedure Settings
************************ */
98 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
99 /* Settings for
THIS-PROCEDURE
101 External Tables
: ttpl.RP
102 Allow
: Basic
,DB-Fields
104 Add Fields to
: EXTERNAL-TABLES
105 Other Settings
: PERSISTENT-ONLY
COMPILE
108 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
109 /* then cleanup and return.
*/
110 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
111 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
112 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
116 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
118 /* ************************* Create Window
************************** */
120 &ANALYZE-SUSPEND _CREATE-WINDOW
121 /* DESIGN Window definition
(used by the UIB
)
122 CREATE WINDOW V-table-Win
ASSIGN
125 /* END WINDOW DEFINITION
*/
130 /* *************** Runtime Attributes and UIB Settings
************** */
132 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
133 /* SETTINGS
FOR WINDOW V-table-Win
134 VISIBLE,,RUN-PERSISTENT
*/
135 /* SETTINGS
FOR FRAME F-Main
136 NOT-VISIBLE Size-to-Fit
*/
138 FRAME F-Main
:SCROLLABLE = FALSE
139 FRAME F-Main
:HIDDEN = TRUE.
141 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
143 /* _RUN-TIME-ATTRIBUTES-END
*/
147 /* Setting information for Queries and Browse Widgets fields
*/
149 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
150 /* Query rebuild information for
FRAME F-Main
153 */ /* FRAME F-Main
*/
159 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
160 /* ************************* Included-Libraries
*********************** */
162 {src
/adm
/method
/viewer.i
}
163 {inc
/method
/m-mntvwr.i
}
165 /* _UIB-CODE-BLOCK-END
*/
171 /* ************************ Control Triggers
************************ */
173 &Scoped-define SELF-NAME btn_print
174 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_print V-table-Win
175 ON CHOOSE OF btn_print
IN FRAME F-Main
/* OK */
179 SELF:SENSITIVE = Yes.
182 /* _UIB-CODE-BLOCK-END
*/
186 &Scoped-define SELF-NAME cmb_MonthFrom
187 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_MonthFrom V-table-Win
188 ON U1
OF cmb_MonthFrom
IN FRAME F-Main
/* From month
*/
190 {inc
/selcmb
/scmths1.i
"RP" "Int3"}
193 /* _UIB-CODE-BLOCK-END
*/
197 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_MonthFrom V-table-Win
198 ON U2
OF cmb_MonthFrom
IN FRAME F-Main
/* From month
*/
200 {inc
/selcmb
/scmths2.i
"RP" "Int3"}
203 /* _UIB-CODE-BLOCK-END
*/
209 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
212 /* *************************** Main Block
*************************** */
214 /* _UIB-CODE-BLOCK-END
*/
218 /* ********************** Internal Procedures
*********************** */
220 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win
221 PROCEDURE adm-row-available
:
222 /*------------------------------------------------------------------------------
223 Purpose
: Override
(thoroughly
!) the Progress adm-row-available
224 ------------------------------------------------------------------------------*/
226 /* Define variables needed by this internal procedure.
*/
227 {src
/adm
/template
/row-head.i
}
229 /* Create a list of all the tables that we need to get.
*/
230 {src
/adm
/template
/row-list.i
"Creditor"}
232 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
233 {src
/adm
/template
/row-get.i
}
235 /* FIND each record specified by the RECORD-SOURCE.
*/
236 {src
/adm
/template
/row-find.i
"Creditor"}
238 /* Process the newly available records
(i.e. display fields
,
239 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
240 {src
/adm
/template
/row-end.i
}
244 /* _UIB-CODE-BLOCK-END
*/
248 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
249 PROCEDURE disable_UI
:
250 /*------------------------------------------------------------------------------
251 Purpose
: DISABLE the User Interface
253 Notes
: Here we clean-up the user-interface by deleting
254 dynamic widgets we have created and
/or hide
255 frames. This procedure is usually called when
256 we are ready to
"clean-up" after running.
257 ------------------------------------------------------------------------------*/
258 /* Hide all frames.
*/
260 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
263 /* _UIB-CODE-BLOCK-END
*/
267 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
268 PROCEDURE enable-appropriate-fields
:
269 /*------------------------------------------------------------------------------
271 ------------------------------------------------------------------------------*/
272 DO WITH FRAME {&FRAME-NAME}:
278 /* _UIB-CODE-BLOCK-END
*/
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
283 PROCEDURE inst-enable-fields
:
284 /*------------------------------------------------------------------------------
286 ------------------------------------------------------------------------------*/
288 RUN enable-appropriate-fields.
292 /* _UIB-CODE-BLOCK-END
*/
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
297 PROCEDURE inst-initialize
:
298 /*------------------------------------------------------------------------------
300 ------------------------------------------------------------------------------*/
301 DEF VAR user-name
AS CHAR NO-UNDO.
303 {inc
/username.i
"user-name"}
305 FIND RP
WHERE RP.UserName
= user-name
306 AND RP.ReportID
= {&REPORT-ID} NO-ERROR.
308 IF NOT AVAILABLE RP
THEN DO WITH FRAME {&FRAME-NAME}:
310 ASSIGN RP.ReportID
= {&REPORT-ID}
311 RP.UserName
= user-name
317 RUN dispatch
( 'display-fields'
:U
).
318 RUN dispatch
( 'enable-fields'
:U
).
322 /* _UIB-CODE-BLOCK-END
*/
326 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
327 PROCEDURE pre-destroy
:
328 /*------------------------------------------------------------------------------
332 ------------------------------------------------------------------------------*/
334 RUN check-modified
( "CLEAR" ).
338 /* _UIB-CODE-BLOCK-END
*/
342 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
343 PROCEDURE run-report
:
344 /*------------------------------------------------------------------------------
345 Purpose
: Actually run the report through RB engine.
346 ------------------------------------------------------------------------------*/
347 DEF VAR report-options
AS CHAR NO-UNDO.
350 IF RETURN-VALUE = "FAIL" THEN RETURN.
352 RUN dispatch
( 'update-record'
:U
).
354 report-options
= "FromMonth," + STRING( RP.Int3
)
355 + (IF RP.Log1
THEN "~nPreview" ELSE "").
357 RUN notify
( 'set-busy
, CONTAINER-SOURCE'
:U
).
358 RUN forecast
/amtrust-to-budgets.p
( report-options
).
359 RUN notify
( 'set-idle
, CONTAINER-SOURCE'
:U
).
363 /* _UIB-CODE-BLOCK-END
*/
367 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win
368 PROCEDURE send-records
:
369 /*------------------------------------------------------------------------------
371 ------------------------------------------------------------------------------*/
373 /* Define variables needed by this internal procedure.
*/
374 {src
/adm
/template
/snd-head.i
}
376 /* For each requested table
, put it's
ROWID in the output list.
*/
377 {src
/adm
/template
/snd-list.i
"Creditor"}
379 /* Deal with any unexpected table requests before closing.
*/
380 {src
/adm
/template
/snd-end.i
}
384 /* _UIB-CODE-BLOCK-END
*/
388 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
389 PROCEDURE state-changed
:
390 /* -----------------------------------------------------------
394 -------------------------------------------------------------*/
395 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
396 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
399 /* Object instance CASEs can go here to replace standard behavior
401 {src
/adm
/template
/vstates.i
}
405 /* _UIB-CODE-BLOCK-END
*/
409 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-report V-table-Win
410 PROCEDURE verify-report
:
411 /*------------------------------------------------------------------------------
413 ------------------------------------------------------------------------------*/
418 /* _UIB-CODE-BLOCK-END
*/