Dúvida progress

Discussão em 'EMS , HCM e Totvs 11' iniciado por Carlos Alberto Giusti, Novembro 28, 2024.

  1. Carlos Alberto Giusti

    Carlos Alberto Giusti Membro Ativo

    No programa abaixo na aba digitação, ao colocar o depósito precisa vir ao lado o nome do depósito.
    Onde faço isso?. Não consegui.

    Também preciso que na aba impressão venha defout destino = 2 e o caminho este: session:temp-directory + "-" + "esce3000" + "-" + string(today, "99/99/9999") + "-" + string(time, "HH:MM:SS").
    Como faço. Já tentei de varias maneiras e não deu certo.


    &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
    &ANALYZE-RESUME
    /* Connected Databases
    */
    &Scoped-define WINDOW-NAME w-relat
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS w-relat
    /*:T*******************************************************************************
    ** Copyright TOTVS S.A. (2009)
    ** Todos os Direitos Reservados.
    **
    ** Este fonte e de propriedade exclusiva da TOTVS, sua reproducao
    ** parcial ou total por qualquer meio, so podera ser feita mediante
    ** autorizacao expressa.
    *******************************************************************************/
    {include/i-prgvrs.i ESCE3000 2.04.00.000}

    /* Chamada a include do gerenciador de licenças. Necessario alterar os parametros */
    /* */
    /* <programa>: Informar qual o nome do programa. */
    /* <módulo>: Informar qual o módulo a qual o programa pertence. */

    &IF "{&EMSFND_VERSION}" >= "1.00" &THEN
    {include/i-license-manager.i <programa> <módulo>}
    &ENDIF

    /* Create an unnamed pool to store all the widgets created
    by this procedure. This is a good default which assures
    that this procedure's triggers and internal procedures
    will execute in this procedure's storage, and that proper
    cleanup will occur on deletion of the procedure. */

    CREATE WIDGET-POOL.

    /* *************************** Definitions ************************** */

    /*:T Preprocessadores do Template de Relatório */
    /*:T Obs: Retirar o valor do preprocessador para as páginas que não existirem */

    &GLOBAL-DEFINE PGSEL f-pg-sel
    &GLOBAL-DEFINE PGDIG f-pg-dig
    &GLOBAL-DEFINE PGIMP f-pg-imp

    &GLOBAL-DEFINE RTF YES
    /* Parameters Definitions --- */

    /* Temporary Table Definitions --- */

    define temp-table tt-param no-undo
    field destino as integer
    field arquivo as char format "x(35)"
    field usuario as char format "x(12)"
    field data-exec as date
    field hora-exec as integer
    field classifica as integer
    field desc-classifica as char format "x(40)"
    field modelo-rtf as char format "x(35)"
    field l-habilitaRtf as LOG
    field it-ini as char format "x(16)"
    field it-fim as char format "x(16)"
    field fam-ini as char format "x(12)"
    field fam-fim as char format "x(12)"
    field dep-ini as char format "x(04)"
    field dep-fim as char format "x(04)"
    field loc-ini as char format "x(12)"
    field loc-fim as char format "x(12)"
    field i-depos as log
    field i-etiq as log.

    define temp-table tt-digita no-undo
    FIELD dep AS CHAR FORMAT "x(05)" LABEL "Dep"
    FIELD c-dep AS CHARACTER FORMAT "X(30)" LABEL "Descrrição".
    /* field ordem as integer format ">>>>9"
    field exemplo as character format "x(30)"
    index id ordem. */
    /*INDEX id01 IS PRIMARY UNIQUE c-item.*/

    define buffer b-tt-digita for tt-digita.

    /* Transfer Definitions */

    def var raw-param as raw no-undo.

    def temp-table tt-raw-digita
    field raw-digita as raw.

    /* Local Variable Definitions --- */

    def var l-ok as logical no-undo.
    def var c-arq-digita as char no-undo.
    def var c-terminal as char no-undo.
    def var c-rtf as char no-undo.
    def var c-modelo-default as char no-undo.

    /*15/02/2005 - tech1007 - Variavel definida para tratar se o programa está rodando no WebEnabler*/
    DEFINE SHARED VARIABLE hWenController AS HANDLE NO-UNDO.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK

    /* ******************** Preprocessor Definitions ******************** */

    &Scoped-define PROCEDURE-TYPE w-relat
    &Scoped-define DB-AWARE no

    /* Name of designated FRAME-NAME and/or first browse and/or first query */
    &Scoped-define FRAME-NAME f-pg-dig
    &Scoped-define BROWSE-NAME br-digita

    /* Internal Tables (found by Frame, Query & Browse Queries) */
    &Scoped-define INTERNAL-TABLES tt-digita

    /* Definitions for BROWSE br-digita */
    &Scoped-define FIELDS-IN-QUERY-br-digita tt-digita.dep tt-digita.c-dep
    &Scoped-define ENABLED-FIELDS-IN-QUERY-br-digita tt-digita.dep tt-digita.c-dep
    &Scoped-define ENABLED-TABLES-IN-QUERY-br-digita tt-digita
    &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-br-digita tt-digita
    &Scoped-define SECOND-ENABLED-TABLE-IN-QUERY-br-digita
    &Scoped-define SELF-NAME br-digita
    &Scoped-define QUERY-STRING-br-digita FOR EACH tt-digita
    &Scoped-define OPEN-QUERY-br-digita OPEN QUERY br-digita FOR EACH tt-digita.
    &Scoped-define TABLES-IN-QUERY-br-digita tt-digita
    &Scoped-define FIRST-TABLE-IN-QUERY-br-digita tt-digita


    /* Definitions for FRAME f-pg-dig */
    &Scoped-define OPEN-BROWSERS-IN-QUERY-f-pg-dig ~
    ~{&OPEN-QUERY-br-digita}

    /* Standard List Definitions */
    &Scoped-Define ENABLED-OBJECTS br-digita bt-inserir bt-recuperar

    /* Custom List Definitions */
    /* List-1,List-2,List-3,List-4,List-5,List-6 */

    /* _UIB-PREPROCESSOR-BLOCK-END */
    &ANALYZE-RESUME



    /* *********************** Control Definitions ********************** */

    /* Define the widget handle for the window */
    DEFINE VAR w-relat AS WIDGET-HANDLE NO-UNDO.

    /* Definitions of the field level widgets */
    DEFINE BUTTON bt-alterar
    LABEL "Alterar"
    SIZE 15 BY 1.

    DEFINE BUTTON bt-inserir
    LABEL "Inserir"
    SIZE 15 BY 1.

    DEFINE BUTTON bt-recuperar
    LABEL "Recuperar"
    SIZE 15 BY 1.

    DEFINE BUTTON bt-retirar
    LABEL "Retirar"
    SIZE 15 BY 1.

    DEFINE BUTTON bt-salvar
    LABEL "Salvar"
    SIZE 15 BY 1.

    DEFINE BUTTON bt-arquivo
    IMAGE-UP FILE "image\im-sea":U
    IMAGE-INSENSITIVE FILE "image\ii-sea":U
    LABEL ""
    SIZE 4 BY 1.

    DEFINE BUTTON bt-config-impr
    IMAGE-UP FILE "image\im-cfprt":U
    LABEL ""
    SIZE 4 BY 1.

    DEFINE BUTTON bt-modelo-rtf
    IMAGE-UP FILE "image\im-sea":U
    IMAGE-INSENSITIVE FILE "image\ii-sea":U
    LABEL ""
    SIZE 4 BY 1.

    DEFINE VARIABLE c-arquivo AS CHARACTER
    VIEW-AS EDITOR MAX-CHARS 256
    SIZE 40 BY .88
    BGCOLOR 15 NO-UNDO.

    DEFINE VARIABLE c-modelo-rtf AS CHARACTER
    VIEW-AS EDITOR MAX-CHARS 256
    SIZE 40 BY .88
    BGCOLOR 15 NO-UNDO.

    DEFINE VARIABLE text-destino AS CHARACTER FORMAT "X(256)":U INITIAL " Destino"
    VIEW-AS TEXT
    SIZE 8.57 BY .63 NO-UNDO.

    DEFINE VARIABLE text-modelo-rtf AS CHARACTER FORMAT "X(256)":U INITIAL "Modelo:"
    VIEW-AS TEXT
    SIZE 10.86 BY .63 NO-UNDO.

    DEFINE VARIABLE text-modo AS CHARACTER FORMAT "X(256)":U INITIAL "Execução"
    VIEW-AS TEXT
    SIZE 10.86 BY .63 NO-UNDO.

    DEFINE VARIABLE text-rtf AS CHARACTER FORMAT "X(256)":U INITIAL "Rich Text Format(RTF)"
    VIEW-AS TEXT
    SIZE 20.86 BY .63 NO-UNDO.

    DEFINE VARIABLE rs-destino AS INTEGER INITIAL 2
    VIEW-AS RADIO-SET HORIZONTAL
    RADIO-BUTTONS
    "Impressora", 1,
    "Arquivo", 2,
    "Terminal", 3
    SIZE 44 BY 1.08 NO-UNDO.

    DEFINE VARIABLE rs-execucao AS INTEGER INITIAL 1
    VIEW-AS RADIO-SET HORIZONTAL
    RADIO-BUTTONS
    "On-Line", 1,
    "Batch", 2
    SIZE 27.72 BY .92 NO-UNDO.

    DEFINE RECTANGLE RECT-7
    EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
    SIZE 46.29 BY 2.79.

    DEFINE RECTANGLE RECT-9
    EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
    SIZE 46.29 BY 1.71.

    DEFINE RECTANGLE rect-rtf
    EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
    SIZE 46.29 BY 3.54.

    DEFINE VARIABLE l-habilitaRtf AS LOGICAL INITIAL no
    LABEL "RTF"
    VIEW-AS TOGGLE-BOX
    SIZE 44 BY 1.08 NO-UNDO.

    DEFINE VARIABLE dep-fim AS CHARACTER FORMAT "X(05)":U INITIAL "041"
    VIEW-AS FILL-IN
    SIZE 5 BY .88 NO-UNDO.

    DEFINE VARIABLE dep-ini AS CHARACTER FORMAT "X(05)":U INITIAL "041"
    LABEL "Depósito"
    VIEW-AS FILL-IN
    SIZE 5 BY .88 NO-UNDO.

    DEFINE VARIABLE fam-fim AS CHARACTER FORMAT "X(12)":U INITIAL "ZZZZZZZZZZZZ"
    VIEW-AS FILL-IN
    SIZE 13 BY .88 NO-UNDO.

    DEFINE VARIABLE fam-ini AS CHARACTER FORMAT "X(12)":U
    LABEL "Família Mat"
    VIEW-AS FILL-IN
    SIZE 13 BY .88 NO-UNDO.

    DEFINE VARIABLE it-fim AS CHARACTER FORMAT "X(16)":U INITIAL "ZZZZZZZZZZZZZZZZ"
    VIEW-AS FILL-IN
    SIZE 17 BY .88 NO-UNDO.

    DEFINE VARIABLE it-ini AS CHARACTER FORMAT "X(16)":U
    LABEL "Item"
    VIEW-AS FILL-IN
    SIZE 17 BY .88 NO-UNDO.

    DEFINE VARIABLE loc-fim AS CHARACTER FORMAT "X(12)":U INITIAL "ZZZZZZZZZZZZ"
    VIEW-AS FILL-IN
    SIZE 13 BY .88 NO-UNDO.

    DEFINE VARIABLE loc-ini AS CHARACTER FORMAT "X(12)":U
    LABEL "Localização"
    VIEW-AS FILL-IN
    SIZE 13 BY .88 NO-UNDO.

    DEFINE IMAGE IMAGE-1
    FILENAME "image\im-fir":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-2
    FILENAME "image\im-las":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-3
    FILENAME "image\im-fir":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-4
    FILENAME "image\im-las":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-5
    FILENAME "image\im-fir":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-6
    FILENAME "image\im-las":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-7
    FILENAME "image\im-fir":U
    SIZE 3 BY .88.

    DEFINE IMAGE IMAGE-8
    FILENAME "image\im-las":U
    SIZE 3 BY .88.

    DEFINE VARIABLE i-depos AS LOGICAL INITIAL no
    LABEL "Depósito"
    VIEW-AS TOGGLE-BOX
    SIZE 20.43 BY .83 NO-UNDO.

    DEFINE VARIABLE i-etiq AS LOGICAL INITIAL no
    LABEL "Exibir Etiquetas"
    VIEW-AS TOGGLE-BOX
    SIZE 20.43 BY .83 NO-UNDO.

    DEFINE BUTTON bt-ajuda
    LABEL "Ajuda"
    SIZE 10 BY 1.

    DEFINE BUTTON bt-cancelar AUTO-END-KEY
    LABEL "Fechar"
    SIZE 10 BY 1.

    DEFINE BUTTON bt-executar
    LABEL "Executar"
    SIZE 10 BY 1.

    DEFINE IMAGE im-pg-dig
    FILENAME "image\im-fldup":U
    SIZE 15.72 BY 1.21.

    DEFINE IMAGE im-pg-imp
    FILENAME "image\im-fldup":U
    SIZE 15.72 BY 1.21.

    DEFINE IMAGE im-pg-sel
    FILENAME "image\im-fldup":U
    SIZE 15.72 BY 1.21.

    DEFINE RECTANGLE RECT-1
    EDGE-PIXELS 2 GRAPHIC-EDGE
    SIZE 79 BY 1.42
    BGCOLOR 7 .

    DEFINE RECTANGLE RECT-6
    EDGE-PIXELS 0
    SIZE 78.72 BY .13
    BGCOLOR 7 .

    DEFINE RECTANGLE rt-folder
    EDGE-PIXELS 1 GRAPHIC-EDGE NO-FILL
    SIZE 79 BY 11.38
    FGCOLOR 0 .

    DEFINE RECTANGLE rt-folder-left
    EDGE-PIXELS 0
    SIZE .43 BY 11.21
    BGCOLOR 15 .

    DEFINE RECTANGLE rt-folder-right
    EDGE-PIXELS 0
    SIZE .43 BY 11.17
    BGCOLOR 7 .

    DEFINE RECTANGLE rt-folder-top
    EDGE-PIXELS 0
    SIZE 78.72 BY .13
    BGCOLOR 15 .

    /* Query definitions */
    &ANALYZE-SUSPEND
    DEFINE QUERY br-digita FOR
    tt-digita SCROLLING.
    &ANALYZE-RESUME

    /* Browse definitions */
    DEFINE BROWSE br-digita
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br-digita w-relat _FREEFORM
    QUERY br-digita DISPLAY
    tt-digita.dep
    tt-digita.c-dep
    /*tt-digita.exemplo*/
    ENABLE
    tt-digita.dep
    tt-digita.c-dep
    /*tt-digita.exemplo*/
    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME
    WITH SEPARATORS SIZE 76.57 BY 9
    BGCOLOR 15 .


    /* ************************ Frame Definitions *********************** */

    DEFINE FRAME f-pg-imp
    rs-destino AT ROW 1.63 COL 3.29 HELP
    "Destino de Impressão do Relatório" NO-LABEL
    bt-arquivo AT ROW 2.71 COL 43.29 HELP
    "Escolha do nome do arquivo"
    bt-config-impr AT ROW 2.71 COL 43.29 HELP
    "Configuração da impressora"
    c-arquivo AT ROW 2.75 COL 3.29 HELP
    "Nome do arquivo de destino do relatório" NO-LABEL
    l-habilitaRtf AT ROW 4.83 COL 3.29
    c-modelo-rtf AT ROW 6.63 COL 3 HELP
    "Nome do arquivo de modelo do relatório" NO-LABEL
    bt-modelo-rtf AT ROW 6.63 COL 43 HELP
    "Escolha do nome do arquivo"
    rs-execucao AT ROW 8.88 COL 2.86 HELP
    "Modo de Execução" NO-LABEL
    text-destino AT ROW 1.04 COL 3.86 NO-LABEL
    text-rtf AT ROW 4.17 COL 1.14 COLON-ALIGNED NO-LABEL
    text-modelo-rtf AT ROW 5.96 COL 1.14 COLON-ALIGNED NO-LABEL
    text-modo AT ROW 8.13 COL 1.14 COLON-ALIGNED NO-LABEL
    rect-rtf AT ROW 4.46 COL 2
    RECT-7 AT ROW 1.33 COL 2.14
    RECT-9 AT ROW 8.33 COL 2
    WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
    SIDE-LABELS NO-UNDERLINE THREE-D
    AT COL 3 ROW 3
    SIZE 73.72 BY 10.5 WIDGET-ID 100.

    DEFINE FRAME f-relat
    bt-executar AT ROW 14.54 COL 3 HELP
    "Dispara a execução do relatório"
    bt-cancelar AT ROW 14.54 COL 14 HELP
    "Fechar"
    bt-ajuda AT ROW 14.54 COL 70 HELP
    "Ajuda"
    RECT-1 AT ROW 14.29 COL 2
    RECT-6 AT ROW 13.75 COL 2.14
    rt-folder-top AT ROW 2.54 COL 2.14
    rt-folder-right AT ROW 2.67 COL 80.43
    rt-folder-left AT ROW 2.54 COL 2.14
    rt-folder AT ROW 2.5 COL 2
    im-pg-dig AT ROW 1.5 COL 18
    im-pg-imp AT ROW 1.5 COL 34
    im-pg-sel AT ROW 1.5 COL 2.14
    WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
    SIDE-LABELS NO-UNDERLINE THREE-D
    AT COL 1 ROW 1
    SIZE 81 BY 15
    DEFAULT-BUTTON bt-executar WIDGET-ID 100.

    DEFINE FRAME f-pg-dig
    br-digita AT ROW 1 COL 1
    bt-inserir AT ROW 10 COL 1
    bt-alterar AT ROW 10 COL 16
    bt-retirar AT ROW 10 COL 31
    bt-salvar AT ROW 10 COL 46
    bt-recuperar AT ROW 10 COL 61
    WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
    SIDE-LABELS NO-UNDERLINE THREE-D
    AT COL 3 ROW 3.31
    SIZE 76.86 BY 10.15 WIDGET-ID 100.

    DEFINE FRAME f-pg-sel
    it-ini AT ROW 2.25 COL 15 COLON-ALIGNED
    it-fim AT ROW 2.25 COL 48.14 COLON-ALIGNED NO-LABEL
    fam-ini AT ROW 3.25 COL 15 COLON-ALIGNED
    fam-fim AT ROW 3.25 COL 48.14 COLON-ALIGNED NO-LABEL
    dep-ini AT ROW 4.25 COL 15 COLON-ALIGNED
    dep-fim AT ROW 4.25 COL 48.14 COLON-ALIGNED NO-LABEL
    i-depos AT ROW 4.25 COL 57.43
    loc-ini AT ROW 5.25 COL 15 COLON-ALIGNED
    loc-fim AT ROW 5.25 COL 48.14 COLON-ALIGNED NO-LABEL
    i-etiq AT ROW 7.25 COL 17
    IMAGE-1 AT ROW 2.25 COL 33.86
    IMAGE-2 AT ROW 2.25 COL 47.29
    IMAGE-3 AT ROW 3.25 COL 33.86
    IMAGE-4 AT ROW 3.25 COL 47.29
    IMAGE-5 AT ROW 4.25 COL 33.86
    IMAGE-6 AT ROW 4.25 COL 47.29
    IMAGE-7 AT ROW 5.25 COL 33.86
    IMAGE-8 AT ROW 5.25 COL 47.29
    WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
    SIDE-LABELS NO-UNDERLINE THREE-D
    AT COL 3 ROW 2.85
    SIZE 76.86 BY 10.62 WIDGET-ID 100.


    /* *********************** Procedure Settings ************************ */

    &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
    /* Settings for THIS-PROCEDURE
    Type: w-relat
    Allow: Basic,Browse,DB-Fields,Window,Query
    Add Fields to: Neither
    */
    &ANALYZE-RESUME _END-PROCEDURE-SETTINGS

    /* ************************* Create Window ************************** */

    &ANALYZE-SUSPEND _CREATE-WINDOW
    IF SESSION:DISPLAY-TYPE = "GUI":U THEN
    CREATE WINDOW w-relat ASSIGN
    HIDDEN = YES
    TITLE = "<Title>"
    HEIGHT = 15
    WIDTH = 81.14
    MAX-HEIGHT = 22.33
    MAX-WIDTH = 114.29
    VIRTUAL-HEIGHT = 22.33
    VIRTUAL-WIDTH = 114.29
    RESIZE = yes
    SCROLL-BARS = no
    STATUS-AREA = yes
    BGCOLOR = ?
    FGCOLOR = ?
    KEEP-FRAME-Z-ORDER = yes
    THREE-D = yes
    MESSAGE-AREA = no
    SENSITIVE = yes.
    ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
    /* END WINDOW DEFINITION */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB w-relat
    /* ************************* Included-Libraries *********************** */

    {src/adm/method/containr.i}
    {include/w-relat.i}
    {utp/ut-glob.i}

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME




    /* *********** Runtime Attributes and AppBuilder Settings *********** */

    &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
    /* SETTINGS FOR WINDOW w-relat
    VISIBLE,,RUN-PERSISTENT */
    /* SETTINGS FOR FRAME f-pg-dig
    FRAME-NAME */
    /* BROWSE-TAB br-digita 1 f-pg-dig */
    /* SETTINGS FOR BUTTON bt-alterar IN FRAME f-pg-dig
    NO-ENABLE */
    /* SETTINGS FOR BUTTON bt-retirar IN FRAME f-pg-dig
    NO-ENABLE */
    /* SETTINGS FOR BUTTON bt-salvar IN FRAME f-pg-dig
    NO-ENABLE */
    /* SETTINGS FOR FRAME f-pg-imp
    */
    /* SETTINGS FOR EDITOR c-modelo-rtf IN FRAME f-pg-imp
    NO-ENABLE */
    /* SETTINGS FOR FILL-IN text-destino IN FRAME f-pg-imp
    NO-DISPLAY NO-ENABLE ALIGN-L */
    ASSIGN
    text-destino:pRIVATE-DATA IN FRAME f-pg-imp =
    "Destino".

    ASSIGN
    text-modelo-rtf:pRIVATE-DATA IN FRAME f-pg-imp =
    "Modelo:".

    /* SETTINGS FOR FILL-IN text-modo IN FRAME f-pg-imp
    NO-DISPLAY NO-ENABLE */
    ASSIGN
    text-modo:pRIVATE-DATA IN FRAME f-pg-imp =
    "Execução".

    ASSIGN
    text-rtf:pRIVATE-DATA IN FRAME f-pg-imp =
    "Rich Text Format(RTF)".

    /* SETTINGS FOR FRAME f-pg-sel
    */
    /* SETTINGS FOR FRAME f-relat
    */
    /* SETTINGS FOR RECTANGLE RECT-1 IN FRAME f-relat
    NO-ENABLE */
    /* SETTINGS FOR RECTANGLE RECT-6 IN FRAME f-relat
    NO-ENABLE */
    /* SETTINGS FOR RECTANGLE rt-folder IN FRAME f-relat
    NO-ENABLE */
    /* SETTINGS FOR RECTANGLE rt-folder-left IN FRAME f-relat
    NO-ENABLE */
    /* SETTINGS FOR RECTANGLE rt-folder-right IN FRAME f-relat
    NO-ENABLE */
    /* SETTINGS FOR RECTANGLE rt-folder-top IN FRAME f-relat
    NO-ENABLE */
    IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(w-relat)
    THEN w-relat:HIDDEN = no.

    /* _RUN-TIME-ATTRIBUTES-END */
    &ANALYZE-RESUME


    /* Setting information for Queries and Browse Widgets fields */

    &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br-digita
    /* Query rebuild information for BROWSE br-digita
    _START_FREEFORM
    OPEN QUERY br-digita FOR EACH tt-digita.
    _END_FREEFORM
    _Query is OPENED
    */ /* BROWSE br-digita */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _QUERY-BLOCK FRAME f-pg-imp
    /* Query rebuild information for FRAME f-pg-imp
    _Query is NOT OPENED
    */ /* FRAME f-pg-imp */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _QUERY-BLOCK FRAME f-pg-sel
    /* Query rebuild information for FRAME f-pg-sel
    _Query is NOT OPENED
    */ /* FRAME f-pg-sel */
    &ANALYZE-RESUME





    /* ************************ Control Triggers ************************ */

    &Scoped-define SELF-NAME w-relat
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL w-relat w-relat
    ON END-ERROR OF w-relat /* <Title> */
    OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
    /* This case occurs when the user presses the "Esc" key.
    In a persistently run window, just ignore this. If we did not, the
    application would exit. */
    RETURN NO-APPLY.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL w-relat w-relat
    ON WINDOW-CLOSE OF w-relat /* <Title> */
    DO:
    /* This event will close the window and terminate the procedure. */
    APPLY "CLOSE":U TO THIS-PROCEDURE.
    RETURN NO-APPLY.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define BROWSE-NAME br-digita
    &Scoped-define SELF-NAME br-digita
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON DEL OF br-digita IN FRAME f-pg-dig
    DO:
    apply 'choose':U to bt-retirar in frame f-pg-dig.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON END-ERROR OF br-digita IN FRAME f-pg-dig
    ANYWHERE
    DO:
    if br-digita:new-row in frame f-pg-dig then do:
    if avail tt-digita then
    delete tt-digita.
    if br-digita:delete-current-row() in frame f-pg-dig then.
    end.
    else do:
    get current br-digita.
    display tt-digita.dep
    tt-digita.c-dep
    /*tt-digita.exemplo*/ with browse br-digita.
    end.
    return no-apply.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON ENTER OF br-digita IN FRAME f-pg-dig
    ANYWHERE
    DO:
    apply 'tab':U to self.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON INS OF br-digita IN FRAME f-pg-dig
    DO:
    apply 'choose':U to bt-inserir in frame f-pg-dig.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON OFF-END OF br-digita IN FRAME f-pg-dig
    DO:
    apply 'entry':U to bt-inserir in frame f-pg-dig.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON OFF-HOME OF br-digita IN FRAME f-pg-dig
    DO:
    apply 'entry':U to bt-recuperar in frame f-pg-dig.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON ROW-ENTRY OF br-digita IN FRAME f-pg-dig
    DO:
    /*:T trigger para inicializar campos da temp table de digitação */
    if br-digita:new-row in frame f-pg-dig then do:
    /*assign tt-digita.exemplo:screen-value in browse br-digita = string(today, "99/99/9999").*/
    end.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br-digita w-relat
    ON ROW-LEAVE OF br-digita IN FRAME f-pg-dig
    DO:
    /*:T É aqui que a gravação da linha da temp-table é efetivada.
    Porém as validações dos registros devem ser feitas na procedure pi-executar,
    no local indicado pelo comentário */

    if br-digita:NEW-ROW in frame f-pg-dig then
    do transaction on error undo, return no-apply:
    create tt-digita.
    assign input browse br-digita tt-digita.dep
    INPUT BROWSE br-digita tt-digita.c-dep.
    /*input browse br-digita tt-digita.exemplo.*/

    br-digita:CREATE-RESULT-LIST-ENTRY() in frame f-pg-dig.
    end.
    else do transaction on error undo, return no-apply:
    assign input browse br-digita tt-digita.dep
    INPUT BROWSE br-digita tt-digita.c-dep.
    /*input browse br-digita tt-digita.exemplo.*/
    end.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-relat
    &Scoped-define SELF-NAME bt-ajuda
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-ajuda w-relat
    ON CHOOSE OF bt-ajuda IN FRAME f-relat /* Ajuda */
    DO:
    {include/ajuda.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-dig
    &Scoped-define SELF-NAME bt-alterar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-alterar w-relat
    ON CHOOSE OF bt-alterar IN FRAME f-pg-dig /* Alterar */
    DO:
    apply 'entry':U to tt-digita.dep in browse br-digita.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-imp
    &Scoped-define SELF-NAME bt-arquivo
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-arquivo w-relat
    ON CHOOSE OF bt-arquivo IN FRAME f-pg-imp
    DO:
    {include/i-rparq.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-relat
    &Scoped-define SELF-NAME bt-cancelar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-cancelar w-relat
    ON CHOOSE OF bt-cancelar IN FRAME f-relat /* Fechar */
    DO:
    apply "close":U to this-procedure.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-imp
    &Scoped-define SELF-NAME bt-config-impr
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-config-impr w-relat
    ON CHOOSE OF bt-config-impr IN FRAME f-pg-imp
    DO:
    {include/i-rpimp.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-relat
    &Scoped-define SELF-NAME bt-executar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-executar w-relat
    ON CHOOSE OF bt-executar IN FRAME f-relat /* Executar */
    DO:
    do on error undo, return no-apply:
    run pi-executar.
    end.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-dig
    &Scoped-define SELF-NAME bt-inserir
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-inserir w-relat
    ON CHOOSE OF bt-inserir IN FRAME f-pg-dig /* Inserir */
    DO:


    assign bt-alterar:SENSITIVE in frame f-pg-dig = yes
    bt-retirar:SENSITIVE in frame f-pg-dig = yes
    bt-salvar:SENSITIVE in frame f-pg-dig = yes.

    if num-results("br-digita":U) > 0 then
    br-digita:INSERT-ROW("after":U) in frame f-pg-dig.
    else do transaction:
    create tt-digita.

    open query br-digita for each tt-digita.

    apply "entry":U to tt-digita.dep in browse br-digita.
    end.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-imp
    &Scoped-define SELF-NAME bt-modelo-rtf
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-modelo-rtf w-relat
    ON CHOOSE OF bt-modelo-rtf IN FRAME f-pg-imp
    DO:
    def var c-arq-conv as char no-undo.
    def var l-ok as logical no-undo.

    assign c-modelo-rtf = replace(input frame {&frame-name} c-modelo-rtf, "/", "~\").
    SYSTEM-DIALOG GET-FILE c-arq-conv
    FILTERS "*.rtf" "*.rtf",
    "*.*" "*.*"
    DEFAULT-EXTENSION "rtf"
    INITIAL-DIR "modelos"
    MUST-EXIST
    USE-FILENAME
    UPDATE l-ok.
    if l-ok = yes then
    assign c-modelo-rtf:screen-value in frame {&frame-name} = replace(c-arq-conv, "~\", "/").

    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-dig
    &Scoped-define SELF-NAME bt-recuperar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-recuperar w-relat
    ON CHOOSE OF bt-recuperar IN FRAME f-pg-dig /* Recuperar */
    DO:
    {include/i-rprcd.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-retirar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-retirar w-relat
    ON CHOOSE OF bt-retirar IN FRAME f-pg-dig /* Retirar */
    DO:
    if br-digita:num-selected-rows > 0 then do on error undo, return no-apply:
    get current br-digita.
    delete tt-digita.
    if br-digita:delete-current-row() in frame f-pg-dig then.
    end.

    if num-results("br-digita":U) = 0 then
    assign bt-alterar:SENSITIVE in frame f-pg-dig = no
    bt-retirar:SENSITIVE in frame f-pg-dig = no
    bt-salvar:SENSITIVE in frame f-pg-dig = no.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-salvar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-salvar w-relat
    ON CHOOSE OF bt-salvar IN FRAME f-pg-dig /* Salvar */
    DO:
    {include/i-rpsvd.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-sel
    &Scoped-define SELF-NAME i-depos
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL i-depos w-relat
    ON VALUE-CHANGED OF i-depos IN FRAME f-pg-sel /* Depósito */
    DO:
    IF INPUT FRAME f-pg-sel i-depos = YES THEN DO:


    assign bt-alterar:SENSITIVE in frame f-pg-dig = NO
    bt-retirar:SENSITIVE in frame f-pg-dig = NO
    bt-salvar:SENSITIVE in frame f-pg-dig = NO
    bt-inserir:SENSITIVE in frame f-pg-dig = NO
    bt-recuperar:SENSITIVE in frame f-pg-dig = NO.

    ASSIGN dep-ini:SCREEN-VALUE = ""
    dep-fim:SCREEN-VALUE = "".
    END.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-relat
    &Scoped-define SELF-NAME im-pg-dig
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL im-pg-dig w-relat
    ON MOUSE-SELECT-CLICK OF im-pg-dig IN FRAME f-relat
    DO:
    run pi-troca-pagina.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME im-pg-imp
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL im-pg-imp w-relat
    ON MOUSE-SELECT-CLICK OF im-pg-imp IN FRAME f-relat
    DO:
    run pi-troca-pagina.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME im-pg-sel
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL im-pg-sel w-relat
    ON MOUSE-SELECT-CLICK OF im-pg-sel IN FRAME f-relat
    DO:
    run pi-troca-pagina.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-imp
    &Scoped-define SELF-NAME l-habilitaRtf
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL l-habilitaRtf w-relat
    ON VALUE-CHANGED OF l-habilitaRtf IN FRAME f-pg-imp /* RTF */
    DO:
    &IF "{&RTF}":U = "YES":U &THEN
    RUN pi-habilitaRtf.
    &endif
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME rs-destino
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL rs-destino w-relat
    ON VALUE-CHANGED OF rs-destino IN FRAME f-pg-imp
    DO:
    /*Alterado 15/02/2005 - tech1007 - Evento alterado para correto funcionamento dos novos widgets
    utilizados para a funcionalidade de RTF*/
    do with frame f-pg-imp:
    case self:screen-value:
    when "1" then do:
    assign c-arquivo:sensitive = no
    bt-arquivo:visible = no
    bt-config-impr:visible = YES
    /*Alterado 17/02/2005 - tech1007 - Realizado teste de preprocessador para
    verificar se o RTF está ativo*/
    &IF "{&RTF}":U = "YES":U &THEN
    l-habilitaRtf:sensitive = NO
    l-habilitaRtf:SCREEN-VALUE IN FRAME f-pg-imp = "No"
    l-habilitaRtf = NO
    &endif
    /*Fim alteracao 17/02/2005*/
    .
    end.
    when "2" then do:
    assign c-arquivo:sensitive = yes
    bt-arquivo:visible = yes
    bt-config-impr:visible = NO
    /*Alterado 17/02/2005 - tech1007 - Realizado teste de preprocessador para
    verificar se o RTF está ativo*/
    &IF "{&RTF}":U = "YES":U &THEN
    l-habilitaRtf:sensitive = YES
    &endif
    /*Fim alteracao 17/02/2005*/
    .
    end.
    when "3" then do:
    assign c-arquivo:sensitive = no
    bt-arquivo:visible = no
    bt-config-impr:visible = no
    /*Alterado 17/02/2005 - tech1007 - Realizado teste de preprocessador para
    verificar se o RTF está ativo*/
    &IF "{&RTF}":U = "YES":U &THEN
    l-habilitaRtf:sensitive = YES
    &endif
    /*Fim alteracao 17/02/2005*/
    .
    /*Alterado 15/02/2005 - tech1007 - Teste para funcionar corretamente no WebEnabler*/
    &IF "{&RTF}":U = "YES":U &THEN
    IF VALID-HANDLE(hWenController) THEN DO:
    ASSIGN l-habilitaRtf:sensitive = NO
    l-habilitaRtf:SCREEN-VALUE IN FRAME f-pg-imp = "No"
    l-habilitaRtf = NO.
    END.
    &endif
    /*Fim alteracao 15/02/2005*/
    end.
    end case.
    end.
    &IF "{&RTF}":U = "YES":U &THEN
    RUN pi-habilitaRtf.
    &endif
    /*Fim alteracao 15/02/2005*/
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME rs-execucao
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL rs-execucao w-relat
    ON VALUE-CHANGED OF rs-execucao IN FRAME f-pg-imp
    DO:
    {include/i-rprse.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define FRAME-NAME f-pg-dig
    &UNDEFINE SELF-NAME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK w-relat


    /* *************************** Main Block *************************** */

    /* Set CURRENT-WINDOW: this will parent dialog-boxes and frames. */
    ASSIGN CURRENT-WINDOW = {&WINDOW-NAME}
    THIS-PROCEDURE:CURRENT-WINDOW = {&WINDOW-NAME}.

    {utp/ut9000.i "ESCE3000" "2.04.00.000"}

    /*:T inicializações do template de relatório */
    {include/i-rpini.i}

    /* The CLOSE event can be used from inside or outside the procedure to */
    /* terminate it. */
    ON CLOSE OF THIS-PROCEDURE
    RUN disable_UI.

    {include/i-rplbl.i}

    /* Best default for GUI applications is... */
    PAUSE 0 BEFORE-HIDE.

    /* Now enable the interface and wait for the exit condition. */
    /* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */
    MAIN-BLOCK:
    DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
    ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:

    RUN enable_UI.

    {include/i-rpmbl.i}
    IF NOT THIS-PROCEDURE:pERSISTENT THEN
    WAIT-FOR CLOSE OF THIS-PROCEDURE.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    /* ********************** Internal Procedures *********************** */

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects w-relat _ADM-CREATE-OBJECTS
    PROCEDURE adm-create-objects :
    /*------------------------------------------------------------------------------
    Purpose: Create handles for all SmartObjects used in this procedure.
    After SmartObjects are initialized, then SmartLinks are added.
    Parameters: <none>
    ------------------------------------------------------------------------------*/

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available w-relat _ADM-ROW-AVAILABLE
    PROCEDURE adm-row-available :
    /*------------------------------------------------------------------------------
    Purpose: Dispatched to this procedure when the Record-
    Source has a new row available. This procedure
    tries to get the new row (or foriegn keys) from
    the Record-Source and process it.
    Parameters: <none>
    ------------------------------------------------------------------------------*/

    /* Define variables needed by this internal procedure. */
    {src/adm/template/row-head.i}

    /* Process the newly available records (i.e. display fields,
    open queries, and/or pass records on to any RECORD-TARGETS). */
    {src/adm/template/row-end.i}

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI w-relat _DEFAULT-DISABLE
    PROCEDURE disable_UI :
    /*------------------------------------------------------------------------------
    Purpose: DISABLE the User Interface
    Parameters: <none>
    Notes: Here we clean-up the user-interface by deleting
    dynamic widgets we have created and/or hide
    frames. This procedure is usually called when
    we are ready to "clean-up" after running.
    ------------------------------------------------------------------------------*/
    /* Delete the WINDOW we created */
    IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(w-relat)
    THEN DELETE WIDGET w-relat.
    IF THIS-PROCEDURE:pERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI w-relat _DEFAULT-ENABLE
    PROCEDURE enable_UI :
    /*------------------------------------------------------------------------------
    Purpose: ENABLE the User Interface
    Parameters: <none>
    Notes: Here we display/view/enable the widgets in the
    user-interface. In addition, OPEN all queries
    associated with each FRAME and BROWSE.
    These statements here are based on the "Other
    Settings" section of the widget Property Sheets.
    ------------------------------------------------------------------------------*/
    ENABLE im-pg-dig im-pg-imp im-pg-sel bt-executar bt-cancelar bt-ajuda
    WITH FRAME f-relat IN WINDOW w-relat.
    {&OPEN-BROWSERS-IN-QUERY-f-relat}
    DISPLAY it-ini it-fim fam-ini fam-fim dep-ini dep-fim i-depos loc-ini loc-fim
    i-etiq
    WITH FRAME f-pg-sel IN WINDOW w-relat.
    ENABLE IMAGE-1 IMAGE-2 IMAGE-3 IMAGE-4 IMAGE-5 IMAGE-6 IMAGE-7 IMAGE-8 it-ini
    it-fim fam-ini fam-fim dep-ini dep-fim i-depos loc-ini loc-fim i-etiq
    WITH FRAME f-pg-sel IN WINDOW w-relat.
    {&OPEN-BROWSERS-IN-QUERY-f-pg-sel}
    DISPLAY rs-destino c-arquivo l-habilitaRtf c-modelo-rtf rs-execucao text-rtf
    text-modelo-rtf
    WITH FRAME f-pg-imp IN WINDOW w-relat.
    ENABLE rect-rtf RECT-7 RECT-9 rs-destino bt-arquivo bt-config-impr c-arquivo
    l-habilitaRtf bt-modelo-rtf rs-execucao text-rtf text-modelo-rtf
    WITH FRAME f-pg-imp IN WINDOW w-relat.
    {&OPEN-BROWSERS-IN-QUERY-f-pg-imp}
    ENABLE br-digita bt-inserir bt-recuperar
    WITH FRAME f-pg-dig IN WINDOW w-relat.
    {&OPEN-BROWSERS-IN-QUERY-f-pg-dig}
    VIEW w-relat.
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-exit w-relat
    PROCEDURE local-exit :
    /* -----------------------------------------------------------
    Purpose: Starts an "exit" by APPLYing CLOSE event, which starts "destroy".
    Parameters: <none>
    Notes: If activated, should APPLY CLOSE, *not* dispatch adm-exit.
    -------------------------------------------------------------*/
    APPLY "CLOSE":U TO THIS-PROCEDURE.

    RETURN.

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pi-executar w-relat
    PROCEDURE pi-executar :
    /*------------------------------------------------------------------------------
    Purpose:
    Parameters: <none>
    Notes:
    ------------------------------------------------------------------------------*/
    define var r-tt-digita as rowid no-undo.

    do on error undo, return error on stop undo, return error:
    {include/i-rpexa.i}
    /*14/02/2005 - tech1007 - Alterada condicao para não considerar mai o RTF como destino*/
    if input frame f-pg-imp rs-destino = 2 and
    input FRAME f-pg-imp rs-execucao = 1 then do:
    MESSAGE "oi" VIEW-AS ALERT-BOX.
    ASSIGN c-arquivo = session:temp-directory + "-" + "esce3000" + "-" + string(today, "99/99/9999") + "-" + string(time, "HH:MM:SS").
    run utp/ut-vlarq.p (input input frame f-pg-imp c-arquivo).

    if return-value = "NOK":U then do:
    run utp/ut-msgs.p (input "show":U, input 73, input "").

    apply "MOUSE-SELECT-CLICK":U to im-pg-imp in frame f-relat.
    apply "ENTRY":U to c-arquivo in frame f-pg-imp.
    return error.
    end.

    end.

    /*14/02/2005 - tech1007 - Teste efetuado para nao permitir modelo em branco*/
    &IF "{&RTF}":U = "YES":U &THEN
    IF ( INPUT FRAME f-pg-imp c-modelo-rtf = "" AND
    INPUT FRAME f-pg-imp l-habilitaRtf = "Yes" ) OR
    ( SEARCH(INPUT FRAME f-pg-imp c-modelo-rtf) = ? AND
    input frame f-pg-imp rs-execucao = 1 AND
    INPUT FRAME f-pg-imp l-habilitaRtf = "Yes" )
    THEN DO:
    run utp/ut-msgs.p (input "show":U, input 73, input "").
    apply "MOUSE-SELECT-CLICK":U to im-pg-imp in frame f-relat.
    /*30/12/2004 - tech1007 - Evento removido pois causa problemas no WebEnabler*/
    /*apply "CHOOSE":U to bt-modelo-rtf in frame f-pg-imp.*/
    return error.
    END.
    &endif
    /*Fim teste Modelo*/

    /*:T Coloque aqui as validações da página de Digitação, lembrando que elas devem
    apresentar uma mensagem de erro cadastrada, posicionar nesta página e colocar
    o focus no campo com problemas */
    /*browse br-digita:SET-REPOSITIONED-ROW (browse br-digita:DOWN, "ALWAYS":U).*/

    for each tt-digita no-lock:
    assign r-tt-digita = rowid(tt-digita).

    /*:T Validação de duplicidade de registro na temp-table tt-digita */
    find first b-tt-digita where b-tt-digita.dep = tt-digita.dep and
    rowid(b-tt-digita) <> rowid(tt-digita) no-lock no-error.
    if avail b-tt-digita then do:
    apply "MOUSE-SELECT-CLICK":U to im-pg-dig in frame f-relat.
    reposition br-digita to rowid rowid(b-tt-digita).

    run utp/ut-msgs.p (input "show":U, input 108, input "").
    apply "ENTRY":U to tt-digita.dep in browse br-digita.

    return error.
    end.

    /*:T As demais validações devem ser feitas aqui */
    /*if tt-digita.c-item <= 0 then do:*/
    FIND deposito NO-LOCK WHERE deposito.cod-depos = tt-digita.dep NO-ERROR.
    IF NOT AVAIL deposito THEN DO:
    assign browse br-digita:CURRENT-COLUMN = tt-digita.dep:HANDLE in browse br-digita.

    apply "MOUSE-SELECT-CLICK":U to im-pg-dig in frame f-relat.
    reposition br-digita to rowid r-tt-digita.

    run utp/ut-msgs.p (input "show":U, input 99999, input "").
    apply "ENTRY":U to tt-digita.dep in browse br-digita.

    return error.
    end.
    ELSE DO:

    ASSIGN tt-digita.c-dep = deposito.nome.

    END.

    end.


    /*:T Coloque aqui as validações das outras páginas, lembrando que elas devem
    apresentar uma mensagem de erro cadastrada, posicionar na página com
    problemas e colocar o focus no campo com problemas */



    /*:T Aqui são gravados os campos da temp-table que será passada como parâmetro
    para o programa RP.P */

    create tt-param.
    assign tt-param.usuario = c-seg-usuario
    tt-param.destino = input frame f-pg-imp rs-destino
    tt-param.data-exec = today
    tt-param.hora-exec = TIME.

    /*Alterado 14/02/2005 - tech1007 - Alterado o teste para verificar se a opção de RTF está selecionada*/
    if tt-param.destino = 1
    then assign tt-param.arquivo = "".
    else if tt-param.destino = 2
    then assign tt-param.arquivo = input frame f-pg-imp c-arquivo.
    else assign tt-param.arquivo = session:temp-directory + c-programa-mg97 + ".tmp":U.
    /*Fim alteracao 14/02/2005*/

    /*:T Coloque aqui a/lógica de gravação dos demais campos que devem ser passados
    como parâmetros para o programa RP.P, através da temp-table tt-param */

    ASSIGN tt-param.dep-ini = INPUT FRAME f-pg-sel dep-ini
    tt-param.dep-fim = INPUT FRAME f-pg-sel dep-fim
    tt-param.it-ini = INPUT FRAME f-pg-sel it-ini
    tt-param.it-fim = INPUT FRAME f-pg-sel it-fim
    tt-param.fam-ini = INPUT FRAME f-pg-sel fam-ini
    tt-param.fam-fim = INPUT FRAME f-pg-sel fam-fim
    tt-param.loc-ini = INPUT FRAME f-pg-sel loc-ini
    tt-param.loc-fim = INPUT FRAME f-pg-sel loc-fim
    tt-param.i-depos = INPUT FRAME f-pg-sel i-depos
    tt-param.i-etiq = INPUT FRAME f-pg-sel i-etiq.

    /*:T Executar do programa RP.P que irá criar o relatório */
    {include/i-rpexb.i}

    SESSION:SET-WAIT-STATE("general":U).

    {include/i-rprun.i cep/esce3000rp.p}

    {include/i-rpexc.i}

    SESSION:SET-WAIT-STATE("":U).

    {include/i-rptrm.i}

    END.
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pi-troca-pagina w-relat
    PROCEDURE pi-troca-pagina :
    /*:T------------------------------------------------------------------------------
    Purpose: Gerencia a Troca de Página (folder)
    Parameters: <none>
    Notes:
    ------------------------------------------------------------------------------*/

    {include/i-rptrp.i}

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records w-relat _ADM-SEND-RECORDS
    PROCEDURE send-records :
    /*------------------------------------------------------------------------------
    Purpose: Send record ROWID's for all tables used by
    this file.
    Parameters: see template/snd-head.i
    ------------------------------------------------------------------------------*/

    /* Define variables needed by this internal procedure. */
    {src/adm/template/snd-head.i}

    /* For each requested table, put it's ROWID in the output list. */
    {src/adm/template/snd-list.i "tt-digita"}

    /* Deal with any unexpected table requests before closing. */
    {src/adm/template/snd-end.i}

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed w-relat
    PROCEDURE state-changed :
    /* -----------------------------------------------------------
    Purpose:
    Parameters: <none>
    Notes:
    -------------------------------------------------------------*/
    DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
    DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
    run pi-trata-state (p-issuer-hdl, p-state).
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME
  2. bootstrapmaster

    bootstrapmaster Moderator Moderador Equipe de Suporte

    NO caso do browse, vc cria uma variavel em definitions chamada descricao por exemplo, dai vai no browse e inclui na opção campo calculado essa variavel, formata certinho, se for browse tipo freeform, vai no evento display e coloca essa variavel la com a formatação correta, no evento row-display vc preenche a variavel com a informação que vc precisa.
    Se quer que preencha a variavel no momento da inclusão, basta criar no bloco main do programa um gatilho on 'leave' of campo in browse blablabla e nesse evento vc preenche a variavel descricao.

    Sobre o campo destino, duplo clique nele na tela, no botão avancar vc altera o valor inicial.
  3. Carlos Alberto Giusti

    Carlos Alberto Giusti Membro Ativo

    No campo destino preciso que venha defout destino = 2 e o caminho este: session:temp-directory + "-" + "esce3000" + "-" + string(today, "99/99/9999") + "-" + string(time, "HH:MM:SS").
  4. bootstrapmaster

    bootstrapmaster Moderator Moderador Equipe de Suporte

    no on 'value-changed' do campo rs-destino vc pode preencher com o que vc precisa.
    Lembre de ao entrar no programa, no main do programa, fazer um apply 'value-chaged' no rs-destino pra que ele preencha o campo como precisa.
  5. Carlos Alberto Giusti

    Carlos Alberto Giusti Membro Ativo

    Ok

    E como mudo a aba que vou visualizar e dar manutenção.
    O programa já abre na aba seleção e preciso acessar aba digitação e depois aba impressão.
  6. bootstrapmaster

    bootstrapmaster Moderator Moderador Equipe de Suporte

    upload_2024-11-28_15-6-21.png
    8o. botão, depois do lapis, antes da lupa, clica nele, abre uma tela com todos os objectos do programa, seleciona a frame que vc quer mexer e dai clica no primeiro botão da esquerda pra direita, que ele traz a frame pra cima das outras.

Compartilhe esta Página