3 Replies Latest reply on Apr 2, 2013 4:26 AM by Jade

    Aligning columns of 3 Fields in a Calculated  Drop Down List field

    CStovin

      Title

      Aligning columns of 3 Fields in a Calculated  Drop Down List field

      Post

           I have a text field with a calculation --->    INVENTORY::full_name = product_category & mnf_name & product_name

           My LINES portal which is in ORDER,   has the standard kf_products_id also set to display a second field under the value list which is full_name.

           To make the drop down list in the Lines portal easier to read how can I add  " alignment or a set position "  for product_category,  mnf_name,  and the product_name ?

           I guess I don't have to add a set position for the first field in full name ( product_category )  as it would default to the Left,  but I would need a function to keep the other two fields in aligned columns.... 

           (((such as always begin the second field 30 characters away from the first character in the first field..... and begin the third field 30 characters away from the first character in the second field )))

        • 1. Re: Aligning columns of 3 Fields in a Calculated  Drop Down List field
          Jade

               In your calculation, you can pad each field by concatenating a tab character.  If your product category, names, etc., vary considerably in length, the drop-down list may look better when padded with extra spaces instead of tabs.

               e.g.

               INVENTORY::full_name = product_category & Char(9) & mnf_name & Char(9) & product_name

               or

               INVENTORY::full_name = Left( product_category & "                                   " ; 30) & Left( mnf_name & "                                "; 30) & product_name

          • 2. Re: Aligning columns of 3 Fields in a Calculated  Drop Down List field
            CStovin

                 Hi Jade, thanks for your tip.

                 I came across a post that had this info which was from a couple years ago, so I guess it still stands as one quick way to make it work.

                  

                 After reading up on the Left function I'm a bit confused as how the number of spaces in the "                        "  works, and also how the number after works with it.

                 I tried changing up the number of spaces in the  "             ' & the ; ##  but had difficulty dicerning what the changes were doing.    Does this method make the columns square ?   Will there always be some lines that are out of squared aligned depending on how many characters are in the field ?

                 If this method - as good as it is, for what it can do can not be improved ( because I don't understand the coding yet ),   is there another method such as dropping a three field sorted portal on top of my     drop down    _kf_products_id field , which would remove the need for a value list ?

                  

            • 3. Re: Aligning columns of 3 Fields in a Calculated  Drop Down List field
              Jade

                   The number of spaces between the quotation marks ("…") are concatenated to the suffix of your values in the respective fields.  The number—in this case, 30—in the Left() function takes that number of characters from the vaules & spaces starting from the left and truncates the rest.  So the resultant calculation will have 30 characters each for the product_category and mnf_name fields. Since the product_name is in the last column, it does not need padding.

                   If you use a uniformly spaced font like Courier, the columns of full_name in the drop-down should align well.  With other fonts, there may be ragged edges (since some characters (e.g. 'mnop' ) take up more room that other (e.g. 'filt').  If you don't like Courier, concatenate one or more 'tab' characters to your fields instead of spaces as shown in my post above.