1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 DEF VAR user-name
AS CHAR INITIAL "Andrew" NO-UNDO.
17 /* _UIB-CODE-BLOCK-END
*/
21 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
23 /* ******************** Preprocessor Definitions
******************** */
25 &Scoped-define PROCEDURE-TYPE SmartViewer
26 &Scoped-define DB-AWARE no
28 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
30 /* Name of first Frame and
/or Browse and
/or first Query
*/
31 &Scoped-define FRAME-NAME F-Main
34 &Scoped-define EXTERNAL-TABLES RP
35 &Scoped-define FIRST-EXTERNAL-TABLE RP
38 /* Need to scope the external tables to this procedure
*/
39 DEFINE QUERY external_tables
FOR RP.
40 /* Standard List Definitions
*/
41 &Scoped-Define ENABLED-FIELDS RP.Char1 RP.Int1 RP.Int5 RP.Int2 RP.Int6 ~
42 RP.Log1 RP.Log5 RP.Char3 RP.Log2
43 &Scoped-define ENABLED-TABLES RP
44 &Scoped-define FIRST-ENABLED-TABLE RP
45 &Scoped-Define ENABLED-OBJECTS cmb_month1 cmb_month2 btn_Browse Btn_OK ~
47 &Scoped-Define DISPLAYED-FIELDS RP.Char1 RP.Int1 RP.Int5 RP.Int2 RP.Int6 ~
48 RP.Log1 RP.Log5 RP.Char3 RP.Log2
49 &Scoped-define DISPLAYED-TABLES RP
50 &Scoped-define FIRST-DISPLAYED-TABLE RP
51 &Scoped-Define DISPLAYED-OBJECTS fil_cred1 fil_comp1 fil_cred2 fil_comp2 ~
54 /* Custom List Definitions
*/
55 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
56 &Scoped-define ADM-CREATE-FIELDS RP.Log2
57 &Scoped-define ADM-ASSIGN-FIELDS RP.Log2
59 /* _UIB-PREPROCESSOR-BLOCK-END
*/
64 /* *********************** Control Definitions
********************** */
67 /* Definitions of the field level widgets
*/
68 DEFINE BUTTON btn_Browse
73 DEFINE BUTTON Btn_OK
AUTO-GO DEFAULT
78 DEFINE VARIABLE cmb_month1
AS CHARACTER FORMAT "X(256)":U
80 VIEW-AS COMBO-BOX INNER-LINES 15
83 SIZE 17.14 BY 1 NO-UNDO.
85 DEFINE VARIABLE cmb_month2
AS CHARACTER FORMAT "X(256)":U
87 VIEW-AS COMBO-BOX INNER-LINES 15
90 SIZE 17.14 BY 1 NO-UNDO.
92 DEFINE VARIABLE fil_comp1
AS CHARACTER FORMAT "X(256)":U
97 DEFINE VARIABLE fil_comp2
AS CHARACTER FORMAT "X(256)":U
102 DEFINE VARIABLE fil_cred1
AS CHARACTER FORMAT "X(256)":U
107 DEFINE VARIABLE fil_cred2
AS CHARACTER FORMAT "X(256)":U
112 DEFINE RECTANGLE RECT-1
113 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
117 /* ************************ Frame Definitions
*********************** */
120 RP.Char1
AT ROW 1.5 COL 3 NO-LABEL
121 VIEW-AS RADIO-SET VERTICAL
123 "All creditors", "All":U
,
124 "for a single Creditor", "C1":U
,
125 "for a range of Creditor Codes", "CR":U
,
126 "Creditors of a single company", "L1":U
,
127 "Creditors of a range of companies", "LR":U
130 RP.Int1
AT ROW 7.2 COL 10 COLON-ALIGNED HELP
132 LABEL "Creditor" FORMAT "99999"
135 RP.Int5
AT ROW 7.2 COL 10 COLON-ALIGNED
136 LABEL "Company" FORMAT "99999"
139 fil_cred1
AT ROW 7.2 COL 19.14 COLON-ALIGNED NO-LABEL
140 fil_comp1
AT ROW 7.2 COL 19.14 COLON-ALIGNED NO-LABEL
141 RP.Int2
AT ROW 8.2 COL 10 COLON-ALIGNED HELP
143 LABEL "to" FORMAT "99999"
146 RP.Int6
AT ROW 8.2 COL 10 COLON-ALIGNED
147 LABEL "to" FORMAT "99999"
150 fil_cred2
AT ROW 8.2 COL 19.14 COLON-ALIGNED NO-LABEL
151 fil_comp2
AT ROW 8.2 COL 19.14 COLON-ALIGNED NO-LABEL
152 cmb_month1
AT ROW 9.65 COL 10 COLON-ALIGNED
153 cmb_month2
AT ROW 9.65 COL 36.29 COLON-ALIGNED
154 RP.Log1
AT ROW 11.25 COL 12 HELP
156 LABEL "Include closed transactions"
160 RP.Log5
AT ROW 12.25 COL 12
165 RP.Char3
AT ROW 12.25 COL 20.29 COLON-ALIGNED HELP
166 "" NO-LABEL FORMAT "X(256)"
169 btn_Browse
AT ROW 12.25 COL 66.29
170 RP.Log2
AT ROW 13.25 COL 12 HELP
176 Btn_OK
AT ROW 13.45 COL 60
177 RECT-1
AT ROW 1 COL 1
178 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
179 SIDE-LABELS NO-UNDERLINE THREE-D
180 AT COL 1 ROW 1 SCROLLABLE
182 DEFAULT-BUTTON Btn_OK.
185 /* *********************** Procedure Settings
************************ */
187 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
188 /* Settings for
THIS-PROCEDURE
190 External Tables
: ttpl.RP
191 Allow
: Basic
,DB-Fields
193 Add Fields to
: EXTERNAL-TABLES
194 Other Settings
: PERSISTENT-ONLY
COMPILE
197 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
198 /* then cleanup and return.
*/
199 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
200 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
201 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
205 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
207 /* ************************* Create Window
************************** */
209 &ANALYZE-SUSPEND _CREATE-WINDOW
210 /* DESIGN Window definition
(used by the UIB
)
211 CREATE WINDOW V-table-Win
ASSIGN
214 /* END WINDOW DEFINITION
*/
218 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
219 /* ************************* Included-Libraries
*********************** */
221 {src
/adm
/method
/viewer.i
}
222 {inc
/method
/m-mntvwr.i
}
224 /* _UIB-CODE-BLOCK-END
*/
230 /* *********** Runtime Attributes and AppBuilder Settings
*********** */
232 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
233 /* SETTINGS
FOR WINDOW V-table-Win
234 VISIBLE,,RUN-PERSISTENT
*/
235 /* SETTINGS
FOR FRAME F-Main
236 NOT-VISIBLE Size-to-Fit
*/
238 FRAME F-Main
:SCROLLABLE = FALSE
239 FRAME F-Main
:HIDDEN = TRUE.
241 /* SETTINGS
FOR FILL-IN RP.Char3
IN FRAME F-Main
242 EXP-LABEL EXP-FORMAT EXP-HELP
*/
243 /* SETTINGS
FOR FILL-IN fil_comp1
IN FRAME F-Main
245 /* SETTINGS
FOR FILL-IN fil_comp2
IN FRAME F-Main
247 /* SETTINGS
FOR FILL-IN fil_cred1
IN FRAME F-Main
249 /* SETTINGS
FOR FILL-IN fil_cred2
IN FRAME F-Main
251 /* SETTINGS
FOR FILL-IN RP.Int1
IN FRAME F-Main
252 EXP-LABEL EXP-FORMAT EXP-HELP
*/
253 /* SETTINGS
FOR FILL-IN RP.Int2
IN FRAME F-Main
254 EXP-LABEL EXP-FORMAT EXP-HELP
*/
255 /* SETTINGS
FOR FILL-IN RP.Int5
IN FRAME F-Main
256 EXP-LABEL EXP-FORMAT
*/
257 /* SETTINGS
FOR FILL-IN RP.Int6
IN FRAME F-Main
258 EXP-LABEL EXP-FORMAT
*/
259 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
260 EXP-LABEL EXP-HELP
*/
261 /* SETTINGS
FOR TOGGLE-BOX RP.Log2
IN FRAME F-Main
262 1 2 EXP-LABEL EXP-HELP
*/
263 /* SETTINGS
FOR TOGGLE-BOX RP.Log5
IN FRAME F-Main
265 /* _RUN-TIME-ATTRIBUTES-END
*/
269 /* Setting information for Queries and Browse Widgets fields
*/
271 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
272 /* Query rebuild information for
FRAME F-Main
275 */ /* FRAME F-Main
*/
282 /* ************************ Control Triggers
************************ */
284 &Scoped-define SELF-NAME btn_Browse
285 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Browse V-table-Win
286 ON CHOOSE OF btn_Browse
IN FRAME F-Main
/* Browse
*/
288 RUN select-file-dialog .
291 /* _UIB-CODE-BLOCK-END
*/
295 &Scoped-define SELF-NAME Btn_OK
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
297 ON CHOOSE OF Btn_OK
IN FRAME F-Main
/* OK */
299 DISABLE Btn_OK
WITH FRAME {&FRAME-NAME}.
301 ENABLE Btn_OK
WITH FRAME {&FRAME-NAME}.
304 /* _UIB-CODE-BLOCK-END
*/
308 &Scoped-define SELF-NAME RP.Char1
309 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
310 ON VALUE-CHANGED
OF RP.Char1
IN FRAME F-Main
/* Char1
*/
312 RUN enable-appropriate-fields.
315 /* _UIB-CODE-BLOCK-END
*/
319 &Scoped-define SELF-NAME cmb_month1
320 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month1 V-table-Win
321 ON U1
OF cmb_month1
IN FRAME F-Main
/* Period
*/
323 {inc
/selcmb
/scmths1.i
"RP" "Int3"}
326 /* _UIB-CODE-BLOCK-END
*/
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month1 V-table-Win
331 ON U2
OF cmb_month1
IN FRAME F-Main
/* Period
*/
333 {inc
/selcmb
/scmths2.i
"RP" "Int3"}
336 /* _UIB-CODE-BLOCK-END
*/
340 &Scoped-define SELF-NAME cmb_month2
341 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month2 V-table-Win
342 ON U1
OF cmb_month2
IN FRAME F-Main
/* To
*/
344 {inc
/selcmb
/scmthe1.i
"RP" "Int4"}
347 /* _UIB-CODE-BLOCK-END
*/
351 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month2 V-table-Win
352 ON U2
OF cmb_month2
IN FRAME F-Main
/* To
*/
354 {inc
/selcmb
/scmthe2.i
"RP" "Int4"}
357 /* _UIB-CODE-BLOCK-END
*/
361 &Scoped-define SELF-NAME fil_comp1
362 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
363 ON U1
OF fil_comp1
IN FRAME F-Main
365 {inc
/selfil
/sfcmp1.i
"RP" "Int5"}
368 /* _UIB-CODE-BLOCK-END
*/
372 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
373 ON U2
OF fil_comp1
IN FRAME F-Main
375 {inc
/selfil
/sfcmp2.i
"RP" "Int5"}
378 /* _UIB-CODE-BLOCK-END
*/
382 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
383 ON U3
OF fil_comp1
IN FRAME F-Main
385 {inc
/selfil
/sfcmp3.i
"RP" "Int5"}
388 /* _UIB-CODE-BLOCK-END
*/
392 &Scoped-define SELF-NAME fil_comp2
393 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
394 ON U1
OF fil_comp2
IN FRAME F-Main
396 {inc
/selfil
/sfcmp1.i
"RP" "Int6"}
399 /* _UIB-CODE-BLOCK-END
*/
403 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
404 ON U2
OF fil_comp2
IN FRAME F-Main
406 {inc
/selfil
/sfcmp2.i
"RP" "Int6"}
409 /* _UIB-CODE-BLOCK-END
*/
413 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
414 ON U3
OF fil_comp2
IN FRAME F-Main
416 {inc
/selfil
/sfcmp3.i
"RP" "Int6"}
419 /* _UIB-CODE-BLOCK-END
*/
423 &Scoped-define SELF-NAME fil_cred1
424 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred1 V-table-Win
425 ON U1
OF fil_cred1
IN FRAME F-Main
427 {inc
/selfil
/sfcrd1.i
"RP" "Int1"}
430 /* _UIB-CODE-BLOCK-END
*/
434 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred1 V-table-Win
435 ON U2
OF fil_cred1
IN FRAME F-Main
437 {inc
/selfil
/sfcrd2.i
"RP" "Int1"}
440 /* _UIB-CODE-BLOCK-END
*/
444 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred1 V-table-Win
445 ON U3
OF fil_cred1
IN FRAME F-Main
447 {inc
/selfil
/sfcrd3.i
"RP" "Int1"}
450 /* _UIB-CODE-BLOCK-END
*/
454 &Scoped-define SELF-NAME fil_cred2
455 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred2 V-table-Win
456 ON U1
OF fil_cred2
IN FRAME F-Main
458 {inc
/selfil
/sfcrd1.i
"RP" "Int2"}
461 /* _UIB-CODE-BLOCK-END
*/
465 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred2 V-table-Win
466 ON U2
OF fil_cred2
IN FRAME F-Main
468 {inc
/selfil
/sfcrd2.i
"RP" "Int2"}
471 /* _UIB-CODE-BLOCK-END
*/
475 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred2 V-table-Win
476 ON U3
OF fil_cred2
IN FRAME F-Main
478 {inc
/selfil
/sfcrd3.i
"RP" "Int2"}
481 /* _UIB-CODE-BLOCK-END
*/
485 &Scoped-define SELF-NAME RP.Int1
486 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
487 ON LEAVE OF RP.Int1
IN FRAME F-Main
/* Creditor
*/
489 {inc
/selcde
/cdcrd.i
"fil_cred1"}
492 /* _UIB-CODE-BLOCK-END
*/
496 &Scoped-define SELF-NAME RP.Int2
497 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
498 ON LEAVE OF RP.Int2
IN FRAME F-Main
/* to
*/
500 {inc
/selcde
/cdcrd.i
"fil_cred2"}
503 /* _UIB-CODE-BLOCK-END
*/
507 &Scoped-define SELF-NAME RP.Int5
508 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int5 V-table-Win
509 ON LEAVE OF RP.Int5
IN FRAME F-Main
/* Company
*/
511 DO WITH FRAME {&FRAME-NAME}:
512 {inc
/selcde
/cdcmp.i
"fil_comp1"}
516 /* _UIB-CODE-BLOCK-END
*/
520 &Scoped-define SELF-NAME RP.Int6
521 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int6 V-table-Win
522 ON LEAVE OF RP.Int6
IN FRAME F-Main
/* to
*/
524 {inc
/selcde
/cdcmp.i
"fil_comp2"}
527 /* _UIB-CODE-BLOCK-END
*/
531 &Scoped-define SELF-NAME RP.Log5
532 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log5 V-table-Win
533 ON VALUE-CHANGED
OF RP.Log5
IN FRAME F-Main
/* Export to
*/
535 RUN enable-appropriate-fields.
538 /* _UIB-CODE-BLOCK-END
*/
544 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
547 /* *************************** Main Block
*************************** */
549 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
550 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
553 /************************ INTERNAL PROCEDURES
********************/
555 /* _UIB-CODE-BLOCK-END
*/
559 /* ********************** Internal Procedures
*********************** */
561 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
562 PROCEDURE adm-row-available
:
563 /*------------------------------------------------------------------------------
564 Purpose
: Dispatched to this procedure when the Record-
565 Source has a new row available. This procedure
566 tries to get the new row
(or foriegn keys
) from
567 the Record-Source and process it.
569 ------------------------------------------------------------------------------*/
571 /* Define variables needed by this internal procedure.
*/
572 {src
/adm
/template
/row-head.i
}
574 /* Create a list of all the tables that we need to get.
*/
575 {src
/adm
/template
/row-list.i
"RP"}
577 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
578 {src
/adm
/template
/row-get.i
}
580 /* FIND each record specified by the RECORD-SOURCE.
*/
581 {src
/adm
/template
/row-find.i
"RP"}
583 /* Process the newly available records
(i.e. display fields
,
584 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
585 {src
/adm
/template
/row-end.i
}
589 /* _UIB-CODE-BLOCK-END
*/
592 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
593 PROCEDURE disable_UI
:
594 /*------------------------------------------------------------------------------
595 Purpose
: DISABLE the User Interface
597 Notes
: Here we clean-up the user-interface by deleting
598 dynamic widgets we have created and
/or hide
599 frames. This procedure is usually called when
600 we are ready to
"clean-up" after running.
601 ------------------------------------------------------------------------------*/
602 /* Hide all frames.
*/
604 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
607 /* _UIB-CODE-BLOCK-END
*/
610 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
611 PROCEDURE enable-appropriate-fields
:
612 /*------------------------------------------------------------------------------
613 Purpose
: As its name
!
614 ------------------------------------------------------------------------------*/
616 DO WITH FRAME {&FRAME-NAME}:
617 IF INPUT RP.Char1
= "All" THEN DO:
618 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred1
:HANDLE ), "HIDDEN = Yes" ).
619 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred2
:HANDLE ), "HIDDEN = Yes" ).
620 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp1
:HANDLE ), "HIDDEN = Yes" ).
621 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp2
:HANDLE ), "HIDDEN = Yes" ).
622 HIDE RP.Int1 fil_cred1 RP.Int2 fil_cred2 RP.Int5 RP.Int6 fil_comp1 fil_comp2.
624 ELSE IF INPUT RP.Char1
= "CR" THEN DO:
625 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred1
:HANDLE ), "HIDDEN = No" ).
626 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred2
:HANDLE ), "HIDDEN = No" ).
627 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp1
:HANDLE ), "HIDDEN = Yes" ).
628 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp2
:HANDLE ), "HIDDEN = Yes" ).
629 VIEW RP.Int1 fil_cred1 RP.Int2 fil_cred2.
630 HIDE RP.Int5 RP.Int6 fil_comp1 fil_comp2.
632 ELSE IF INPUT RP.Char1
= "C1" THEN DO:
633 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred1
:HANDLE ), "HIDDEN = No" ).
634 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred2
:HANDLE ), "HIDDEN = Yes" ).
635 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp1
:HANDLE ), "HIDDEN = Yes" ).
636 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp2
:HANDLE ), "HIDDEN = Yes" ).
637 HIDE RP.Int2 fil_cred2 RP.Int5 RP.Int6 fil_comp1 fil_comp2.
638 VIEW RP.Int1 fil_cred1.
640 ELSE IF INPUT RP.Char1
= "LR" THEN DO:
641 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred1
:HANDLE ), "HIDDEN = Yes" ).
642 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred2
:HANDLE ), "HIDDEN = Yes" ).
643 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp1
:HANDLE ), "HIDDEN = No" ).
644 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp2
:HANDLE ), "HIDDEN = No" ).
645 HIDE RP.Int1 fil_cred1 RP.Int2 fil_cred2.
646 VIEW RP.Int5 fil_comp1 RP.Int6 fil_comp2.
648 ELSE IF INPUT RP.Char1
= "L1" THEN DO:
649 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred1
:HANDLE ), "HIDDEN = Yes" ).
650 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_cred2
:HANDLE ), "HIDDEN = Yes" ).
651 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp1
:HANDLE ), "HIDDEN = No" ).
652 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_comp2
:HANDLE ), "HIDDEN = Yes" ).
653 HIDE RP.Int1 fil_cred1 RP.Int2 fil_cred2 RP.Int6 fil_comp2.
654 VIEW RP.Int5 fil_comp1.
656 IF INPUT RP.Log5
THEN DO:
657 VIEW RP.Char3 btn_Browse .
661 HIDE RP.Char3 btn_Browse .
668 /* _UIB-CODE-BLOCK-END
*/
671 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
672 PROCEDURE inst-initialize
:
673 /*------------------------------------------------------------------------------
674 Purpose
: Initialise the necessary bits and pieces
675 ------------------------------------------------------------------------------*/
676 RUN get-username
IN sec-mgr
( OUTPUT user-name
).
677 FIND RP
WHERE RP.ReportID
= "tr-c"
678 AND RP.UserName
= user-name
681 IF NOT AVAILABLE( RP
) THEN DO:
685 RP.UserName
= user-name
689 RUN dispatch
( 'display-fields'
:U
).
690 RUN dispatch
( 'enable-fields'
:U
).
691 RUN enable-appropriate-fields.
695 /* _UIB-CODE-BLOCK-END
*/
698 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
699 PROCEDURE pre-destroy
:
700 /*------------------------------------------------------------------------------
702 ------------------------------------------------------------------------------*/
703 RUN check-modified
( 'clear'
:U
).
706 /* _UIB-CODE-BLOCK-END
*/
709 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
710 PROCEDURE run-report
:
711 /*------------------------------------------------------------------------------
712 Purpose
: Actually run the report program.
713 ------------------------------------------------------------------------------*/
714 DEF VAR c1
AS INT INITIAL 0 NO-UNDO.
715 DEF VAR c2
AS INT INITIAL 99999 NO-UNDO.
716 DEF VAR e1
AS INT INITIAL 0 NO-UNDO.
717 DEF VAR e2
AS INT INITIAL 99999 NO-UNDO.
718 DEF VAR et
AS CHAR INITIAL "C" NO-UNDO.
719 DEF VAR report-options
AS CHAR NO-UNDO.
721 RUN dispatch
IN THIS-PROCEDURE ('update-record'
:U
).
723 DO WITH FRAME {&FRAME-NAME}:
724 IF RP.Char1
= "CR" THEN DO:
725 ASSIGN c1
= RP.Int1 c2
= RP.Int2 .
727 ELSE IF RP.Char1
= "C1" THEN DO:
728 ASSIGN c1
= RP.Int1 c2
= RP.Int1 .
730 ELSE IF RP.Char1
= "LR" THEN DO:
732 ASSIGN e1
= RP.Int5 e2
= RP.Int6 .
734 ELSE IF RP.Char1
= "L1" THEN DO:
736 ASSIGN e1
= RP.Int5 e2
= RP.Int5 .
738 ELSE IF RP.Char1
= "All" THEN DO:
739 FIND FIRST Creditor
NO-LOCK.
740 c1
= Creditor.CreditorCode.
741 FIND LAST Creditor
NO-LOCK.
742 c2
= Creditor.CreditorCode.
745 report-options
= "EntityType," + et
746 + "~nEntityRange," + STRING(e1
) + "," + STRING(e2
)
747 + "~nCreditorRange," + STRING(c1
) + "," + STRING(c2
)
748 + "~nMonthRange," + STRING(RP.Int3
) + "," + STRING(RP.Int4
)
749 + (IF RP.Log1
THEN "~nShow-All" ELSE "")
750 + (IF RP.Log5
THEN "~nExport," + RP.Char3
ELSE "")
751 + (IF RP.Log2
THEN "~nPreview" ELSE "") .
753 RUN notify
( 'set-busy
,container-source'
:U
).
754 RUN process
/report
/tr-c.p
( report-options
).
755 RUN notify
( 'set-idle
,container-source'
:U
).
759 /* _UIB-CODE-BLOCK-END
*/
762 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
763 PROCEDURE select-file-dialog
:
764 /*------------------------------------------------------------------------------
766 ------------------------------------------------------------------------------*/
767 DEF VAR select-ok
AS LOGICAL INITIAL Yes
NO-UNDO.
768 DEF VAR file-name
AS CHAR NO-UNDO.
769 DEF VAR start-dir
AS CHAR NO-UNDO.
771 file-name
= INPUT FRAME {&FRAME-NAME} RP.Char3 .
772 start-dir
= SUBSTRING( file-name
, 1, R-INDEX(file-name
, "\" ) ).
774 SYSTEM-DIALOG GET-FILE file-name
FILTERS "Comma-separated values" "*.CSV"
775 SAVE-AS ASK-OVERWRITE CREATE-TEST-FILE DEFAULT-EXTENSION ".CSV"
776 INITIAL-DIR start-dir
RETURN-TO-START-DIR
777 TITLE "" USE-FILENAME UPDATE select-ok.
779 IF select-ok
THEN DO:
780 IF SUBSTRING( file-name
, R-INDEX( file-name
, ".") ) <> ".CSV" THEN DO:
781 IF (LENGTH( file-name
) - R-INDEX( file-name
, "." )) < 4 THEN
782 file-name
= SUBSTRING( file-name
, 1, R-INDEX( file-name
, ".")) + "CSV" .
784 RP.Char3
:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
789 /* _UIB-CODE-BLOCK-END
*/
792 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
793 PROCEDURE send-records
:
794 /*------------------------------------------------------------------------------
795 Purpose
: Send record
ROWID's for all tables used by
797 Parameters
: see template
/snd-head.i
798 ------------------------------------------------------------------------------*/
800 /* Define variables needed by this internal procedure.
*/
801 {src
/adm
/template
/snd-head.i
}
803 /* For each requested table
, put it's
ROWID in the output list.
*/
804 {src
/adm
/template
/snd-list.i
"RP"}
806 /* Deal with any unexpected table requests before closing.
*/
807 {src
/adm
/template
/snd-end.i
}
811 /* _UIB-CODE-BLOCK-END
*/
814 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
815 PROCEDURE state-changed
:
816 /* -----------------------------------------------------------
820 -------------------------------------------------------------*/
821 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
822 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
825 /* Object instance CASEs can go here to replace standard behavior
827 {src
/adm
/template
/vstates.i
}
831 /* _UIB-CODE-BLOCK-END
*/