Left justification in dataport

garthgarth Member Posts: 25
How do I left justify text in a fixed field dataport export? Adding spaces to the end of the text does not work.

Comments

  • kinekine Member Posts: 12,562
    The field is text or code? Code trim all spaces from right...

    But why you need to Left-justify the field, if you are using fixed position type? Next field will begin on given position, all between will be filled with spaces... or not?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • garthgarth Member Posts: 25
    Sorry - I meant right justify text on a dataport export - only seems to work if I zero fill the leading spaces, but not if I space fill them.
  • kinekine Member Posts: 12,562
    If you are using CODE type, the leading spaces will be trimmed. Use Text datatype or use the trigger OnAfterFormatField on the Dataport field in this way
    <variablename> - OnAfterFormatField(VAR Text : Text[1024])
    WHILE STRLEN(Text)<10 DO
      Text := ' ' + Text;
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.