Different format of a column for each browse row

andi7171

New Member
Hello,
I need to know, if there is any possibility to have a different format for each row of the same column within ONE browse-widget.

I need a browser, where the user have to key in different type of data for each row - f.i. one row an integer, the next row a decimal and the next row a character --> but all within the same column. (values for rpm, speed, date, time and so on)

I am not sure if it is possible to change the format while displaying the row.

Maybe there is a ocx (grid) which i can use?
Thank you in advance
andi
 
If you want to store data of different data type in one database or temp-table field you need to use the least common denominator which would be the CHARACTER data type since it can hold what you want. Additonally one would need to store the data type which the data should belong to as you might want to convert it back from CHARACTER to it's original data type.

HTH, RealHeavyDude.
 
Hi RealHeavyDude,
thanks for your reply. I already abuse the character-field as a SQL-variant - but I can not modify the display format different for each row of a browse widget. I want that the user can input all the production-data within one browser - not horizontal but verical. Each line is a different format - one for the machine-rpm, one for the material-input, one for the convery-quantity, one for the current and so on - and it is should NOT be allowed to input some characters into a numeric-field.

I think, the only way to do this is an ocx - or to build a viewer with dynamic fill-in´s (thats the way I do it now).
kind regards
andi
 
Assuming you are using some temp table to do it, you could try something like this:

Code:
def temp-table tt no-undo
    field tmp-lineno as int
    field tmp-id as char
    field tmp-val as char
    field tmp-int as int
    field tmp-dec as dec
    field tmp-date as date
    index p1 is primary tmp-lineno.

.... temp table load .....
def query qa for tt scrolling.
def browse b1 query qa
        display tmp-lineno tmp-id tmp-val enable tmp-val
        with 10 down.

def frame f1
    b1
    with row 2 centered no-box.

on row-leave of browse b1 do:
      if tt.tmp-id = 'int'
      then do:
        tt.tmp-int = int(tt.tmp-val:screen-value in browse b1) no-error.
        if error-status:error then do:
            message 'bad number' view-as alert-box.
            apply 'entry' to tt.tmp-val in browse b1.
            return no-apply.
        end.
      .... other validations ....
      end.
end.
open query qa for each tt.
enable all with frame f1.
wait-for window-close of current-window.
 
Back
Top