Dynamic Browse format cell..

Posted by OctavioOlguin on 30-Jan-2018 10:30

I wonder... Why could it be that following code don't work as spected?

CREATE BROWSE hBrowse
        ASSIGN
        X = 17
        Y = 63
        WIDTH = 90
        DOWN = 14
        FRAME = FRAME {&frame-name}:handle
        READ-ONLY  = YES
        SENSITIVE = TRUE
        ROW-MARKERS = TRUE
        SEPARATORS = TRUE
        FIT-LAST-COLUMN = TRUE
        FONT = 1
        TRIGGERS:
            ON DEFAULT-ACTION
                DO:
                    IF AVAILABLE(ttClienteNombre) THEN
                    DO:
                        ASSIGN
                            pSeleccion = ttClienteNombre.cliente.
                        APPLY "GO":U TO FRAME {&FRAME-NAME}.
                    END.
                END.
            ON ROW-DISPLAY
                DO:
                    hBrowse:GET-BROWSE-COLUMN(1):FORMAT = "X(40)".
                    hBrowse:GET-BROWSE-COLUMN(2):FORMAT = "X(15)".
                    hBrowse:GET-BROWSE-COLUMN(2):FORMAT = "X(16)".
                END.
        END TRIGGERS.


    CREATE QUERY hQuery.
    hQuery:SET-BUFFERS(BUFFER ttClienteNombre:handle).

    hQuery:QUERY-PREPARE(cBaseQuery).

    hQuery:QUERY-OPEN ().

    hBrowse:QUERY = hQuery.

    hColumn = hBrowse:ADD-LIKE-COLUMN ("ttClienteNombre.Nombre").
    hColumn = hBrowse:ADD-LIKE-COLUMN ("ttClienteNombre.RFC").
    hColumn = hBrowse:ADD-LIKE-COLUMN ("ttClienteNombre.Cliente").
    hBrowse:GET-BROWSE-COLUMN(1):Width = 35.
    hBrowse:GET-BROWSE-COLUMN(2):Width = 15.
    hBrowse:GET-BROWSE-COLUMN(3):Width = 10.

First, customer name won't shows full name as contained on record, it uses "X(8)", alsto RFC column has same problem.

Width of fields apparently is correct, but not format...

Thanks!

Posted by gdb390 on 30-Jan-2018 10:33

set the format stuff  in the temp-table definition

Posted by Steve Moore on 31-Jan-2018 11:46

One solution is before you add to the browse set via the buffer field handle:

BUFFER ttClienteNombre:HANDLE:BUFFER-FIELD("Nombre"):FORMAT = "X(40)".

All Replies

Posted by gdb390 on 30-Jan-2018 10:33

set the format stuff  in the temp-table definition

Posted by OctavioOlguin on 30-Jan-2018 11:38

thanks [mention:b5de43d9c892484d8d242a9b1a4b6e69:e9ed411860ed4f2ba0265705b8793d05] you nailed it...

Just I wonder, If on a future task, I need diferent format for some field,  I see impractical to make another .i defining TT with other fortmat...

Posted by Steve Moore on 31-Jan-2018 11:46

One solution is before you add to the browse set via the buffer field handle:

BUFFER ttClienteNombre:HANDLE:BUFFER-FIELD("Nombre"):FORMAT = "X(40)".

This thread is closed